Просмотр исходного кода

调整控件样式,增加转换器,增加控件

Jiangsheng 1 месяц назад
Родитель
Сommit
8edfa48b3b

+ 1 - 1
SKMC.UI/Assets/Brushes.xaml

@@ -31,7 +31,7 @@
     <SolidColorBrush x:Key="Brush.SelectionDisabledBackground" Color="{DynamicResource Color.SelectionDisabledBackground}" />
     <SolidColorBrush x:Key="Brush.SelectionDisabledBackground" Color="{DynamicResource Color.SelectionDisabledBackground}" />
     <SolidColorBrush x:Key="Brush.SelectionInactiveBorder" Opacity="0.38" Color="{DynamicResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.SelectionInactiveBorder" Opacity="0.38" Color="{DynamicResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.SelectionSelected" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.SelectionSelected" Color="{DynamicResource Color.Signature}" />
-    <SolidColorBrush x:Key="Brush.SelectionSelectedBackground" Color="{DynamicResource Color.SignatureLight}" />
+    <SolidColorBrush x:Key="Brush.SelectionSelectedBackground" Opacity="0.5" Color="{DynamicResource Color.Signature}" />
 
 
     <SolidColorBrush x:Key="Brush.Label" Color="{DynamicResource Color.Label}" />
     <SolidColorBrush x:Key="Brush.Label" Color="{DynamicResource Color.Label}" />
     <SolidColorBrush x:Key="Brush.SecondaryFont" Opacity="0.6" Color="{DynamicResource Color.Text}" />
     <SolidColorBrush x:Key="Brush.SecondaryFont" Opacity="0.6" Color="{DynamicResource Color.Text}" />

+ 4 - 0
SKMC.UI/Assets/Icons.xaml

@@ -1148,4 +1148,8 @@
         <PathGeometry Figures="M544 704h-192a32 32 0 0 1-32-32v-96a32 32 0 0 1 64 0v64h160v-64a32 32 0 0 1 32-32h192a32 32 0 0 1 32 32v192a32 32 0 0 1-32 32h-192a32 32 0 0 1-32-32v-64z m-64-320v64a32 32 0 0 1-32 32H256a32 32 0 0 1-32-32V256a32 32 0 0 1 32-32h192a32 32 0 0 1 32 32v64h192a32 32 0 0 1 32 32v96a32 32 0 0 1-64 0v-64h-160z m-192 32h128V288H288v128z m320 320h128v-128h-128v128z"/>
         <PathGeometry Figures="M544 704h-192a32 32 0 0 1-32-32v-96a32 32 0 0 1 64 0v64h160v-64a32 32 0 0 1 32-32h192a32 32 0 0 1 32 32v192a32 32 0 0 1-32 32h-192a32 32 0 0 1-32-32v-64z m-64-320v64a32 32 0 0 1-32 32H256a32 32 0 0 1-32-32V256a32 32 0 0 1 32-32h192a32 32 0 0 1 32 32v64h192a32 32 0 0 1 32 32v96a32 32 0 0 1-64 0v-64h-160z m-192 32h128V288H288v128z m320 320h128v-128h-128v128z"/>
     </GeometryGroup>
     </GeometryGroup>
     <PathGeometry x:Key="Icon.Debug" Figures="M547.707 374.32V48.181c0-19.707-16-35.682-35.707-35.682s-35.707 15.975-35.707 35.682V374.32c-61.412 15.926-107.021 71.241-107.021 137.679 0 66.439 45.61 121.778 107.021 137.706v325.114c0 20.268 16 36.683 35.707 36.683s35.707-16.415 35.707-36.707v-325.14c61.413-15.902 107.021-71.267 107.021-137.681 0.001-66.436-45.608-121.728-107.021-137.654zM189.91 730.824c0.244-1.61 0.976-3.073 0.976-4.757V48.181c0-19.707-15.951-35.682-35.707-35.682-19.658 0-35.609 15.975-35.609 35.682v677.886c0 1.684 0.683 3.146 0.927 4.757-63.413 15.779-107.9 72.656-107.998 137.972 0 78.804 63.901 142.705 142.68 142.705 78.828 0 142.729-63.901 142.729-142.705-0.098-65.316-44.585-122.192-107.998-137.972z m-34.731 209.313c-39.365 0-71.315-31.976-71.315-71.39s31.951-71.339 71.364-71.339c39.414 0 71.364 31.95 71.364 71.388 0 39.414-31.95 71.364-71.413 71.341z m856.322-784.934c0-78.803-63.901-142.704-142.729-142.704-78.778 0-142.729 63.901-142.729 142.704 0.146 65.315 44.633 122.191 107.997 137.997-0.194 1.585-0.927 3.073-0.927 4.731v677.912c0 19.682 15.951 35.658 35.658 35.658s35.657-15.977 35.657-35.658V297.931c0-1.658-0.731-3.146-0.927-4.731 63.415-15.805 107.902-72.681 108-137.997z m-142.729 71.363c-39.414 0-71.364-31.974-71.364-71.388s31.999-71.364 71.413-71.34c39.414 0 71.364 31.95 71.364 71.364 0.001 39.439-31.998 71.39-71.413 71.364z"/>
     <PathGeometry x:Key="Icon.Debug" Figures="M547.707 374.32V48.181c0-19.707-16-35.682-35.707-35.682s-35.707 15.975-35.707 35.682V374.32c-61.412 15.926-107.021 71.241-107.021 137.679 0 66.439 45.61 121.778 107.021 137.706v325.114c0 20.268 16 36.683 35.707 36.683s35.707-16.415 35.707-36.707v-325.14c61.413-15.902 107.021-71.267 107.021-137.681 0.001-66.436-45.608-121.728-107.021-137.654zM189.91 730.824c0.244-1.61 0.976-3.073 0.976-4.757V48.181c0-19.707-15.951-35.682-35.707-35.682-19.658 0-35.609 15.975-35.609 35.682v677.886c0 1.684 0.683 3.146 0.927 4.757-63.413 15.779-107.9 72.656-107.998 137.972 0 78.804 63.901 142.705 142.68 142.705 78.828 0 142.729-63.901 142.729-142.705-0.098-65.316-44.585-122.192-107.998-137.972z m-34.731 209.313c-39.365 0-71.315-31.976-71.315-71.39s31.951-71.339 71.364-71.339c39.414 0 71.364 31.95 71.364 71.388 0 39.414-31.95 71.364-71.413 71.341z m856.322-784.934c0-78.803-63.901-142.704-142.729-142.704-78.778 0-142.729 63.901-142.729 142.704 0.146 65.315 44.633 122.191 107.997 137.997-0.194 1.585-0.927 3.073-0.927 4.731v677.912c0 19.682 15.951 35.658 35.658 35.658s35.657-15.977 35.657-35.658V297.931c0-1.658-0.731-3.146-0.927-4.731 63.415-15.805 107.902-72.681 108-137.997z m-142.729 71.363c-39.414 0-71.364-31.974-71.364-71.388s31.999-71.364 71.413-71.34c39.414 0 71.364 31.95 71.364 71.364 0.001 39.439-31.998 71.39-71.413 71.364z"/>
+    <PathGeometry x:Key="Icon.Moon" Figures="M901.12 593.408c-5.632 0-11.264 1.536-16.384 4.096-45.056 22.016-95.744 34.304-149.504 34.304-189.44 0-343.04-153.6-343.04-343.04 0-50.688 11.264-99.328 31.232-142.848 2.048-4.608 3.072-9.216 3.072-14.336 0-18.944-15.36-34.304-34.304-34.304-5.12 0-10.24 1.024-14.336 3.072C213.504 160.768 95.744 318.464 95.744 503.808c0 237.056 192.512 429.568 429.568 429.568 189.44 0 350.208-122.88 407.552-292.864 1.536-4.096 2.56-8.192 2.56-12.8 0-18.944-15.36-34.304-34.304-34.304zM549.888 869.376C320 869.376 163.84 712.192 163.84 483.328c0-119.296 45.056-205.824 164.864-280.064 3.072-1.536 6.144-3.072 9.728-4.096-1.536 3.072-2.56 6.656-3.584 9.728-9.728 49.664-8.704 68.096-6.656 102.912 17.92 243.712 208.384 387.584 400.896 387.584 16.896 0 76.288-9.728 108.544-15.36 3.584-1.536 6.656-2.56 10.24-4.096-1.536 3.072-2.56 6.656-4.096 9.728-40.448 74.24-163.84 179.712-293.888 179.712z m268.8-741.888l-26.624 79.36 50.176 67.072-83.968-1.024-48.128 68.608-25.088-79.872-79.872-25.088 68.608-48.128-1.536-83.968 67.584 50.176z"/>
+    <PathGeometry x:Key="Icon.Sun" Figures="M512.1 801.5c-158.1 0-289.8-131.7-289.8-289.8S354 221.8 512.1 221.8s289.8 131.7 289.8 289.8-131.7 289.9-289.8 289.9z m0-52.7c131.7 0 237.1-105.4 237.1-237.1S643.9 274.5 512.1 274.5 275 379.9 275 511.7s105.4 237.1 237.1 237.1zM485.8 63.7h52.7v105.4h-52.7V63.7z m0 790.5h52.7v105.4h-52.7V854.2zM960 485.3V538H854.6v-52.7H960z m-790.4 0V538H64.2v-52.7h105.4z m642.9-310.9l36.9 36.9-73.8 73.8-36.9-36.9 73.8-73.8zM253.9 733l36.9 36.9-73.8 73.7-36.9-36.9 73.8-73.7z m595.5 79l-36.9 36.9-73.8-73.8 36.9-36.9 73.8 73.8zM290.8 253.4l-36.9 36.9-79-79 36.9-36.9 79 79z"/>
+
+
 </ResourceDictionary>
 </ResourceDictionary>

+ 28 - 0
SKMC.UI/Converters/BoolToOppositeBoolConverter.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace SKMC.UI.Converters
+{
+    // 值转换器:将布尔值转换为相反的布尔值
+    public class BoolToOppositeBoolConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value is bool boolValue)
+            {
+                return !boolValue;
+            }
+            return false;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 31 - 0
SKMC.UI/Converters/BooleanToCollapsedConverter.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace SKMC.UI.Converters
+{
+    public class BooleanToCollapsedConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if ((bool)value)
+            {
+                return Visibility.Visible;
+            }
+            else
+            {
+                return Visibility.Collapsed;
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return null; // ConvertBack is not needed in this case
+        }
+    }
+}

+ 31 - 0
SKMC.UI/Converters/BooleanToInvertedBooleanConverter.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace SKMC.UI.Converters
+{
+    public class BooleanToInvertedBooleanConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                throw new ArgumentNullException("value");
+            }
+            if (!(value is bool))
+            {
+                throw new ArgumentException($"The type of {"value"} ({value.GetType().Name}) is not the type {typeof(bool).Name}!");
+            }
+            return !(bool)value;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return Convert(value, targetType, parameter, culture);
+        }
+    }
+}

+ 10 - 0
SKMC.UI/Converters/Converters.xaml

@@ -0,0 +1,10 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:c="clr-namespace:SKMC.UI.Converters">
+    <c:BooleanToCollapsedConverter x:Key="BooleanToCollapsedConverter"/>
+    <c:StringToBooleanConverter x:Key="StringToBooleanConverter"/>
+    <c:BoolToOppositeBoolConverter x:Key="BoolToOppositeBoolConverter"/>
+    <c:BooleanToInvertedBooleanConverter x:Key="BooleanToInvertedBooleanConverter"/>
+    <c:DateTimeToStringConverter x:Key="DateTimeToStringConverter"/>
+    <c:EnumDescriptionConverter x:Key="EnumDescriptionConverter"/>
+</ResourceDictionary>

+ 43 - 0
SKMC.UI/Converters/DateTimeToStringConverter.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace SKMC.UI.Converters
+{
+    public class DateTimeToStringConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return "";
+            }
+            if (!(value is DateTime dateTime))
+            {
+                throw new ArgumentException($"The type of {"value"} ({value.GetType().Name}) is not the type {typeof(DateTime).Name}!");
+            }
+            return dateTime.ToShortDateString();
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                throw new ArgumentNullException("value");
+            }
+            if (!(value is string))
+            {
+                throw new ArgumentException($"The type of {"value"} ({value.GetType().Name}) is not the type {typeof(string).Name}!");
+            }
+            if (!DateTime.TryParse((string)value, out var result))
+            {
+                throw new ArgumentException($"The value of {"value"} ({value}) cannot be parsed as the type {typeof(DateTime).Name}!");
+            }
+            return result;
+        }
+    }
+}

+ 42 - 0
SKMC.UI/Converters/EnumDescriptionConverter.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Globalization;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace SKMC.UI.Converters
+{
+    public class EnumDescriptionConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null) return null;
+            Type enumType = value.GetType();
+            MemberInfo[] members = enumType.GetMember(value.ToString());
+            if (members.Length > 0)
+            {
+                var attr = members[0].GetCustomAttribute<DescriptionAttribute>();
+                if (attr != null) return attr.Description;
+            }
+            return value.ToString(); // 无描述时显示枚举名
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            // 从ComboBox选中项(描述)反向解析为枚举值
+            if (value == null) return null;
+            string description = value.ToString();
+            foreach (var field in targetType.GetFields())
+            {
+                var attr = field.GetCustomAttribute<DescriptionAttribute>();
+                if (attr != null && attr.Description == description)
+                    return field.GetValue(null);
+            }
+            return Enum.Parse(targetType, description); // 找不到描述时直接解析枚举名
+        }
+    }
+}

+ 37 - 0
SKMC.UI/Converters/StringToBooleanConverter.cs

@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace SKMC.UI.Converters
+{
+    public class StringToBooleanConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            string sValue = value as string;
+            if (value == null)return false;
+            if (bool.TryParse(sValue, out bool result))
+                return result;
+            if (sValue == "TRUE") 
+                return true;
+            else if (sValue == "FALSE")
+            {
+                return false;
+            }
+            return false;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value is bool boolValue)
+                return boolValue.ToString();
+
+            // 处理非布尔值的情况
+            return false.ToString();
+        }
+    }
+}

+ 7 - 1
SKMC.UI/FrameWork.xaml

@@ -1,8 +1,10 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
     <ResourceDictionary.MergedDictionaries>
     <ResourceDictionary.MergedDictionaries>
+        <!--Converters-->
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Converters/Converters.xaml"/>
+        <!--Assets-->
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Colors.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Colors.xaml"/>
-        <!--<ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Themes/Dark.xaml"/>-->
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Brushes.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Brushes.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Font.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Font.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Icons.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Icons.xaml"/>
@@ -16,6 +18,10 @@
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/TextBlock.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/TextBlock.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/DataGrid.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/DataGrid.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/Border.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/Border.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/Calendar.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/DatePicker.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/TapItem.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/ListView.xaml"/>
         <!--Styles-->
         <!--Styles-->
     </ResourceDictionary.MergedDictionaries>
     </ResourceDictionary.MergedDictionaries>
 </ResourceDictionary>
 </ResourceDictionary>

+ 28 - 0
SKMC.UI/SKMC.UI.csproj

@@ -48,6 +48,12 @@
     <Reference Include="PresentationFramework" />
     <Reference Include="PresentationFramework" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
+    <Compile Include="Converters\BooleanToCollapsedConverter.cs" />
+    <Compile Include="Converters\BooleanToInvertedBooleanConverter.cs" />
+    <Compile Include="Converters\BoolToOppositeBoolConverter.cs" />
+    <Compile Include="Converters\DateTimeToStringConverter.cs" />
+    <Compile Include="Converters\EnumDescriptionConverter.cs" />
+    <Compile Include="Converters\StringToBooleanConverter.cs" />
     <Compile Include="CustomControls\SKButton.cs" />
     <Compile Include="CustomControls\SKButton.cs" />
     <Compile Include="CustomControls\SKCheckBox.cs" />
     <Compile Include="CustomControls\SKCheckBox.cs" />
     <Compile Include="CustomControls\SKRadioButton.cs" />
     <Compile Include="CustomControls\SKRadioButton.cs" />
@@ -65,6 +71,8 @@
       <DependentUpon>Settings.settings</DependentUpon>
       <DependentUpon>Settings.settings</DependentUpon>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
     </Compile>
     </Compile>
+    <Compile Include="ValidationRules\DateTimeRule.cs" />
+    <Compile Include="ValidationRules\RangeValidationRule.cs" />
     <EmbeddedResource Include="Properties\Resources.resx">
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -97,10 +105,30 @@
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>
       <DesignTime>True</DesignTime>
       <DesignTime>True</DesignTime>
     </Resource>
     </Resource>
+    <Page Include="Converters\Converters.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\Border.xaml">
     <Page Include="Styles\Border.xaml">
       <SubType>Designer</SubType>
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>
     </Page>
     </Page>
+    <Page Include="Styles\Calendar.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Styles\DatePicker.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Styles\ListView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Styles\TapItem.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Themes\Dark.xaml">
     <Page Include="Themes\Dark.xaml">
       <SubType>Designer</SubType>
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
       <Generator>MSBuild:Compile</Generator>

+ 422 - 0
SKMC.UI/Styles/Calendar.xaml

@@ -0,0 +1,422 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <ResourceDictionary.MergedDictionaries>
+        <!--<ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Themes/Dark.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Brushes.xaml"/>-->
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Icons.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+    <!--年-->
+    <Style x:Key="Calendar.CalendarButton" TargetType="{x:Type CalendarButton}">
+        <Setter Property="Background" Value="{DynamicResource Brush.SignatureAccent}" />
+        <Setter Property="FontSize" Value="15" />
+        <Setter Property="Height" Value="52" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type CalendarButton}">
+                    <Grid>
+                        <Rectangle Name="SelectedBackground" 
+                                   Fill="{TemplateBinding Control.Background}" 
+                                   Opacity="0" 
+                                   RadiusX="26" 
+                                   RadiusY="26" />
+                        <Rectangle Name="Background" 
+                                   Fill="{TemplateBinding Control.Background}" 
+                                   Opacity="0" 
+                                   RadiusX="26" 
+                                   RadiusY="26" />
+                        <ContentPresenter Name="NormalText" Margin="1,0,1,1" 
+                                          HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
+                                          VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
+                                          TextElement.Foreground="{DynamicResource Brush.Text}" />
+                        <VisualStateManager.VisualStateGroups>
+                            <VisualStateGroup x:Name="CommonStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0:0:0.1" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="Normal" />
+                                <VisualState x:Name="MouseOver">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To=".5" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                                <VisualState x:Name="Pressed">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="Background" Storyboard.TargetProperty="Opacity" To=".5" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                            <VisualStateGroup x:Name="SelectionStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="Unselected" />
+                                <VisualState x:Name="Selected">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="SelectedBackground" Storyboard.TargetProperty="Opacity" To=".75" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                            <VisualStateGroup x:Name="ActiveStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="Active" />
+                                <VisualState x:Name="Inactive">
+                                    <Storyboard>
+                                        <ColorAnimation Storyboard.TargetName="NormalText" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" To="#FF777777" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                        </VisualStateManager.VisualStateGroups>
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Width" Value="80" />
+    </Style>
+    <Style x:Key="{x:Type CalendarButton}" BasedOn="{StaticResource Calendar.CalendarButton}" TargetType="{x:Type CalendarButton}" />
+
+    <Style x:Key="Calendar.DayButton" TargetType="{x:Type CalendarDayButton}">
+        <Setter Property="FontFamily" Value="Arial" />
+        <Setter Property="FontSize" Value="13" />
+        <Setter Property="Height" Value="48" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type CalendarDayButton}">
+                    <Grid>
+                        <Ellipse Name="TodayBackground" Opacity="0" 
+                                 Fill="{DynamicResource Brush.Overlay12Percent}" />
+                        <Ellipse Name="SelectedBackground" 
+                                 Fill="{DynamicResource Brush.SignatureAccent}" 
+                                 Opacity="0" />
+                        <Border Background="{TemplateBinding Control.Background}" 
+                                BorderBrush="{TemplateBinding Control.BorderBrush}" 
+                                BorderThickness="{TemplateBinding Control.BorderThickness}" />
+                        <Ellipse Name="HighlightBackground" 
+                                 Fill="{DynamicResource Brush.SignatureAccent}" 
+                                 Opacity="0" />
+                        <ContentPresenter Name="NormalText" Margin="5,1,5,1" 
+                                          HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
+                                          VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
+                                          TextElement.Foreground="{DynamicResource Brush.Text}" />
+                        <Path Name="Blackout" Margin="3" 
+                              HorizontalAlignment="Stretch" 
+                              VerticalAlignment="Stretch" 
+                              Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364" 
+                              Fill="#FF000000" Opacity="0" 
+                              RenderTransformOrigin="0.5,0.5" 
+                              Stretch="Fill" />
+                        <VisualStateManager.VisualStateGroups>
+                            <VisualStateGroup x:Name="CommonStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0:0:0.1" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="Normal" />
+                                <VisualState x:Name="MouseOver">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                                <VisualState x:Name="Pressed">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                                <VisualState x:Name="Disabled">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
+                                        <DoubleAnimation Storyboard.TargetName="NormalText" Storyboard.TargetProperty="Opacity" To=".35" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                            <VisualStateGroup x:Name="SelectionStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="Unselected" />
+                                <VisualState x:Name="Selected">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="SelectedBackground" Storyboard.TargetProperty="Opacity" To=".75" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                            <VisualStateGroup x:Name="CalendarButtonFocusStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0" />
+                                </VisualStateGroup.Transitions>
+                            </VisualStateGroup>
+                            <VisualStateGroup x:Name="ActiveStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="Active" />
+                                <VisualState x:Name="Inactive">
+                                    <Storyboard>
+                                        <ColorAnimation Storyboard.TargetName="NormalText" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" To="#FF777777" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                            <VisualStateGroup x:Name="DayStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="RegularDay" />
+                                <VisualState x:Name="Today">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="TodayBackground" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
+                                        <ColorAnimation Storyboard.TargetName="NormalText" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" To="#FFFFFFFF" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                            <VisualStateGroup x:Name="BlackoutDayStates">
+                                <VisualStateGroup.Transitions>
+                                    <VisualTransition GeneratedDuration="0" />
+                                </VisualStateGroup.Transitions>
+                                <VisualState x:Name="NormalDay" />
+                                <VisualState x:Name="BlackoutDay">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="Blackout" Storyboard.TargetProperty="Opacity" To=".2" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                        </VisualStateManager.VisualStateGroups>
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Width" Value="48" />
+    </Style>
+    <Style x:Key="{x:Type CalendarDayButton}" BasedOn="{StaticResource Calendar.DayButton}" TargetType="{x:Type CalendarDayButton}" />
+
+    <Style x:Key="Calendar.Item" TargetType="{x:Type CalendarItem}">
+        <Setter Property="Height" Value="400" />
+        <Setter Property="Margin" Value="0,3,0,3" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type CalendarItem}">
+                    <FrameworkTemplate.Resources>
+                        <ResourceDictionary>
+                            <DataTemplate x:Key="{x:Static CalendarItem.DayTitleTemplateResourceKey}">
+                                <TextBlock Margin="0,6,0,6" HorizontalAlignment="Center" VerticalAlignment="Center" 
+                                           FontFamily="Arial" 
+                                           FontSize="16" 
+                                           Foreground="{DynamicResource Brush.Text}" 
+                                           Text="{Binding}" />
+                            </DataTemplate>
+                        </ResourceDictionary>
+                    </FrameworkTemplate.Resources>
+                    <Grid Name="PART_Root">
+                        <FrameworkElement.Resources>
+                            <ResourceDictionary>
+                                <SolidColorBrush x:Key="DisabledColor" Color="#A5FFFFFF" />
+                            </ResourceDictionary>
+                        </FrameworkElement.Resources>
+                        <Border Padding="5" Background="{TemplateBinding Control.Background}" 
+                                BorderBrush="{TemplateBinding Control.BorderBrush}" 
+                                BorderThickness="{TemplateBinding Control.BorderThickness}">
+                            <Grid>
+                                <FrameworkElement.Resources>
+                                    <ResourceDictionary>
+                                        <ControlTemplate x:Key="HeaderButtonTemplate" TargetType="{x:Type Button}">
+                                            <Grid Cursor="Hand">
+                                                <ContentPresenter Name="buttonContent" 
+                                                                  Margin="1,4,1,9" 
+                                                                  HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
+                                                                  VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
+                                                                  Content="{TemplateBinding ContentControl.Content}" 
+                                                                  ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" 
+                                                                  TextElement.Foreground="{DynamicResource Brush.Text}" />
+                                            </Grid>
+                                            <ControlTemplate.Triggers>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter TargetName="buttonContent" Property="TextElement.Foreground" Value="{DynamicResource Brush.Signature}" />
+                                                </Trigger>
+                                                <Trigger Property="IsMouseOver" Value="False">
+                                                    <Setter TargetName="buttonContent" Property="TextElement.Foreground" Value="{DynamicResource Brush.Text}" />
+                                                </Trigger>
+                                                <Trigger Property="IsEnabled" Value="False">
+                                                    <Setter TargetName="buttonContent" Property="Opacity" Value=".5" />
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </ResourceDictionary>
+                                </FrameworkElement.Resources>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="Auto" />
+                                    <ColumnDefinition Width="*" />
+                                    <ColumnDefinition Width="Auto" />
+                                </Grid.ColumnDefinitions>
+                                <Grid.RowDefinitions>
+                                    <RowDefinition Height="Auto" />
+                                    <RowDefinition Height="*" />
+                                </Grid.RowDefinitions>
+                                <Button x:Name="PART_PreviousButton" 
+                                        Grid.Row="0" 
+                                        Grid.Column="0" 
+                                        HorizontalAlignment="Left"
+                                        Background="Transparent">
+                                    <Path Width="16" Height="16" StrokeThickness="2" 
+                                          Data="{StaticResource Icon.ChevronLeft}"
+                                          Stretch="Uniform"
+                                          Stroke="{DynamicResource Brush.Icon}"/>
+                                    <Button.Style>
+                                        <Style TargetType="{x:Type Button}">
+                                            <Setter Property="Width" Value="48"/>
+                                            <Setter Property="Height" Value="48"/>
+                                            <Setter Property="HorizontalAlignment" Value="Left"/>
+                                            <Setter Property="VerticalAlignment" Value="Center"/>
+                                            <Setter Property="Focusable" Value="False"/>
+                                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+                                            <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButton}"/>
+                                            <Setter Property="BorderThickness" Value="0"/>
+                                            <Setter Property="Cursor" Value="Hand"/>
+                                            <Style.Triggers>
+                                                <Trigger Property="IsEnabled" Value="False">
+                                                    <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonDisabled}"/>
+                                                </Trigger>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonMouseOver}"/>
+                                                </Trigger>
+                                                <Trigger Property="IsPressed" Value="True">
+                                                    <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonPressed}"/>
+                                                </Trigger>
+                                            </Style.Triggers>
+                                        </Style>
+                                    </Button.Style>
+                                </Button>
+                                <Button Name="PART_HeaderButton"
+                                        Grid.Row="0"
+                                        Grid.Column="1" 
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center" 
+                                        Focusable="False" 
+                                        FontWeight="Bold" 
+                                        FontFamily="Arial" 
+                                        FontSize="16" 
+                                        Template="{StaticResource HeaderButtonTemplate}" />
+                                <Button x:Name="PART_NextButton" 
+                                        Grid.Row="0" 
+                                        Grid.Column="2"
+                                        Background="Transparent">
+                                    <Path Width="16" Height="16" 
+                                          StrokeThickness="2" 
+                                          Data="{StaticResource Icon.ChevronRight}"
+                                          Stroke="{DynamicResource Brush.Icon}"
+                                          Stretch="Uniform"/>
+                                    <Button.Style>
+                                        <Style TargetType="{x:Type Button}">
+                                            <Setter Property="Width" Value="48"/>
+                                            <Setter Property="Height" Value="48"/>
+                                            <Setter Property="HorizontalAlignment" Value="Right"/>
+                                            <Setter Property="VerticalAlignment" Value="Center"/>
+                                            <Setter Property="Focusable" Value="False"/>
+                                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+                                            <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButton}"/>
+                                            <Setter Property="BorderThickness" Value="0"/>
+                                            <Setter Property="Cursor" Value="Hand"/>
+                                            <Style.Triggers>
+                                                <Trigger Property="IsEnabled" Value="False">
+                                                    <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonDisabled}"/>
+                                                </Trigger>
+                                                <Trigger Property="IsMouseOver" Value="True">
+                                                    <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonMouseOver}"/>
+                                                </Trigger>
+                                                <Trigger Property="IsPressed" Value="True">
+                                                    <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonPressed}"/>
+                                                </Trigger>
+                                            </Style.Triggers>
+                                        </Style>
+                                    </Button.Style>
+                                </Button>
+                                <Grid Name="PART_MonthView" Row="1" ColumnSpan="3" Margin="6,-1,6,6" HorizontalAlignment="Center" Visibility="Visible">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                    </Grid.ColumnDefinitions>
+                                    <Grid.RowDefinitions>
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                    </Grid.RowDefinitions>
+                                </Grid>
+                                <Grid Name="PART_YearView" Row="1" ColumnSpan="3" Margin="6,-3,7,6" HorizontalAlignment="Center" Visibility="Hidden">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                        <ColumnDefinition Width="*" />
+                                    </Grid.ColumnDefinitions>
+                                    <Grid.RowDefinitions>
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                        <RowDefinition Height="*" />
+                                    </Grid.RowDefinitions>
+                                </Grid>
+                            </Grid>
+                        </Border>
+                        <Rectangle Name="PART_DisabledVisual" Opacity="0" RadiusX="2" RadiusY="2" Stretch="Fill" StrokeThickness="1" Visibility="Collapsed" 
+                                   Fill="{DynamicResource DisabledColor}" 
+                                   Stroke="{DynamicResource DisabledColor}"/>
+                        <VisualStateManager.VisualStateGroups>
+                            <VisualStateGroup x:Name="CommonStates">
+                                <VisualState x:Name="Normal" />
+                                <VisualState x:Name="Disabled">
+                                    <Storyboard>
+                                        <DoubleAnimation Storyboard.TargetName="PART_DisabledVisual" 
+                                                         Storyboard.TargetProperty="Opacity" 
+                                                         To="1" Duration="0" />
+                                    </Storyboard>
+                                </VisualState>
+                            </VisualStateGroup>
+                        </VisualStateManager.VisualStateGroups>
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="PART_DisabledVisual" Property="Visibility" Value="Visible" />
+                        </Trigger>
+                        <DataTrigger Value="Year" Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}">
+                            <Setter TargetName="PART_MonthView" Property="Visibility" Value="Hidden" />
+                            <Setter TargetName="PART_YearView" Property="Visibility" Value="Visible" />
+                        </DataTrigger>
+                        <DataTrigger Value="Decade" Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}">
+                            <Setter TargetName="PART_MonthView" Property="Visibility" Value="Hidden" />
+                            <Setter TargetName="PART_YearView" Property="Visibility" Value="Visible" />
+                        </DataTrigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Width" Value="400" />
+    </Style>
+    <Style x:Key="{x:Type CalendarItem}" BasedOn="{StaticResource Calendar.Item}" TargetType="{x:Type CalendarItem}" />
+
+    <Style x:Key="Calendar.Primary" TargetType="{x:Type Calendar}">
+        <Setter Property="Background" Value="{DynamicResource Brush.DarkBackground}" />
+        <Setter Property="Calendar.CalendarButtonStyle" Value="{StaticResource Calendar.CalendarButton}" />
+        <Setter Property="Calendar.CalendarDayButtonStyle" Value="{StaticResource Calendar.DayButton}" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Calendar}">
+                    <StackPanel Name="PART_Root" HorizontalAlignment="Center">
+                        <CalendarItem Name="PART_CalendarItem" Background="{TemplateBinding Control.Background}" />
+                    </StackPanel>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <Style x:Key="{x:Type Calendar}" BasedOn="{StaticResource Calendar.Primary}" TargetType="{x:Type Calendar}" />
+
+</ResourceDictionary>

+ 151 - 0
SKMC.UI/Styles/DatePicker.xaml

@@ -0,0 +1,151 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:r="clr-namespace:SKMC.UI.ValidationRules">
+    <ResourceDictionary.MergedDictionaries>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/Calendar.xaml"/>
+        <!--<ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Brushes.xaml"/>-->
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Converters/Converters.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Icons.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+    
+    <!--日期选择-->
+    <Style x:Key="DatePicker.Primary" TargetType="{x:Type DatePicker}">
+        <Setter Property="Height" Value="30"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}" />
+        <Setter Property="Background" Value="#00FFFFFF" />
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="IsDropDownOpen" Value="False"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="DatePicker.IsTodayHighlighted" Value="True" />
+        <Setter Property="Padding" Value="2" />
+        <Setter Property="DatePicker.SelectedDateFormat" Value="Short" />
+        <Setter Property="BorderBrush">
+            <Setter.Value>
+                <LinearGradientBrush StartPoint=".5,1" EndPoint=".5,0">
+                    <GradientStop Offset="0" Color="#FFA3AEB9" />
+                    <GradientStop Offset="0.375" Color="#FF8399A9" />
+                    <GradientStop Offset="0.375" Color="#FF718597" />
+                    <GradientStop Offset="1" Color="#FF617584" />
+                </LinearGradientBrush>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type DatePicker}">
+                    <Border Name="PART_Root"
+                                        BorderBrush="{TemplateBinding BorderBrush}"
+                                        BorderThickness="{TemplateBinding BorderThickness}"
+                                        Background="{TemplateBinding Background}"
+                                        SnapsToDevicePixels="True">
+                        <Grid>
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="*"/>
+                                <ColumnDefinition Width="Auto"/>
+                            </Grid.ColumnDefinitions>
+                            <TextBox x:Name="PART_TextBox" Grid.Column="0" 
+                                 HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
+                                 VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" 
+                                 HorizontalAlignment="Stretch"
+                                 VerticalAlignment="Center"
+                                 Focusable="{TemplateBinding UIElement.Focusable}" 
+                                 Validation.ErrorTemplate="{x:Null}"
+                                 MinWidth="100"
+                                 Background="Transparent"
+                                 BorderThickness="0"
+                                 Foreground="{TemplateBinding Foreground}"
+                                 FontSize="{TemplateBinding FontSize}"
+                                 IsReadOnly="True">
+                                <TextBox.Text>
+                                    <Binding Path="SelectedDate" Converter="{StaticResource DateTimeToStringConverter}" RelativeSource="{RelativeSource AncestorType={x:Type DatePicker}}">
+                                        <Binding.ValidationRules>
+                                            <r:DateTimeRule/>
+                                        </Binding.ValidationRules>
+                                    </Binding>
+                                </TextBox.Text>
+                            </TextBox>
+                            <Grid Name="PART_DisabledVisual" Column="0" ColumnSpan="2" IsHitTestVisible="False" Opacity="0">
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="*" />
+                                    <ColumnDefinition Width="Auto" />
+                                </Grid.ColumnDefinitions>
+                                <Popup Name="PART_Popup" AllowsTransparency="True" Placement="Bottom" StaysOpen="False" PlacementTarget="{Binding ElementName=PART_TextBox}" />
+                            </Grid>
+                            <Button x:Name="PART_Button" 
+                                    Grid.Row="0" 
+                                    Grid.Column="1"
+                                    Margin="5">
+                                <Button.Style>
+                                    <Style TargetType="{x:Type Button}">
+                                        <Setter Property="Height" Value="25"/>
+                                        <Setter Property="Width" Value="25"/>
+                                        <Setter Property="HorizontalAlignment" Value="Center"/>
+                                        <Setter Property="VerticalAlignment" Value="Center"/>
+                                        <Setter Property="Focusable" Value="False"/>
+                                        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+                                        <Setter Property="Background" Value="Transparent"/>
+                                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+                                        <Setter Property="VerticalContentAlignment" Value="Center"/>
+                                        <Setter Property="BorderThickness" Value="0"/>
+                                        <Setter Property="Cursor" Value="Hand"/>
+                                        <Setter Property="Template">
+                                            <Setter.Value>
+                                                <ControlTemplate TargetType="{x:Type Button}">
+                                                    <Border Background="{TemplateBinding Background}"
+                                                            BorderBrush="{TemplateBinding BorderBrush}"
+                                                            BorderThickness="{TemplateBinding BorderThickness}"
+                                                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
+                                                            VerticalAlignment="{TemplateBinding VerticalAlignment}">
+                                                        <Path x:Name="icon" Width="20" Height="20"
+                                                              Data="{StaticResource Icon.Calendar}"
+                                                              Stretch="Uniform"
+                                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                                                    </Border>
+                                                    <ControlTemplate.Triggers>
+                                                        <Trigger Property="IsMouseOver" Value="False">
+                                                            <Setter TargetName="icon" Property="Fill" Value="{DynamicResource Brush.Icon}"/>
+                                                        </Trigger>
+                                                        <Trigger Property="IsMouseOver" Value="True">
+                                                            <Setter TargetName="icon" Property="Fill" Value="{DynamicResource Brush.IconInactive}"/>
+                                                        </Trigger>
+                                                    </ControlTemplate.Triggers>
+                                                </ControlTemplate>
+                                            </Setter.Value>
+                                        </Setter>
+                                        <Style.Triggers>
+                                            <Trigger Property="IsEnabled" Value="False">
+                                                <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonDisabled}"/>
+                                            </Trigger>
+                                            <Trigger Property="IsPressed" Value="True">
+                                                <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButtonPressed}"/>
+                                            </Trigger>
+                                        </Style.Triggers>
+                                    </Style>
+                                </Button.Style>
+                            </Button>
+                            <VisualStateManager.VisualStateGroups>
+                                <VisualStateGroup x:Name="CommonStates">
+                                    <VisualState x:Name="Normal" />
+                                    <VisualState x:Name="Disabled">
+                                        <Storyboard>
+                                            <DoubleAnimation Storyboard.TargetName="PART_DisabledVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
+                                        </Storyboard>
+                                    </VisualState>
+                                </VisualStateGroup>
+                            </VisualStateManager.VisualStateGroups>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <DataTrigger Value="false" Binding="{Binding Source={x:Static SystemParameters.HighContrast}}">
+                            <Setter TargetName="PART_TextBox" Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}" />
+                        </DataTrigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <!-- 日历样式 -->
+        <Setter Property="DatePicker.CalendarStyle" Value="{StaticResource Calendar.Primary}"/>
+    </Style>
+</ResourceDictionary>

+ 421 - 0
SKMC.UI/Styles/ListView.xaml

@@ -0,0 +1,421 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <ResourceDictionary.MergedDictionaries>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Brushes.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/ScrollViewer.xaml"/>
+    </ResourceDictionary.MergedDictionaries>
+    <!--列表头样式-->
+    <Style x:Key="ListView.ColumnHeader" TargetType="{x:Type GridViewColumnHeader}">
+        <Setter Property="SnapsToDevicePixels" Value="True" />
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}" />
+        <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Title}" />
+        <Setter Property="Cursor" Value="Hand" />
+        <Setter Property="Background" Value="{DynamicResource Brush.TextContrast}"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalAlignment" Value="Center" />
+        <Setter Property="BorderBrush" Value="Transparent"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Height" Value="30"/>
+        <!--<Setter Property="Padding" Value="5,0"/>-->
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
+                    <Grid>
+                        <Border x:Name="BackgroundBorder" 
+                                BorderThickness="{TemplateBinding BorderThickness}" 
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                Background="{TemplateBinding Background}"
+                                Height="{TemplateBinding Height}"
+                                Width="{TemplateBinding Width}"
+                                MinHeight="{TemplateBinding MinHeight}"
+                                MinWidth="{TemplateBinding MinWidth}">
+                            <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
+                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                              Content="{TemplateBinding Content}"
+                                              Margin="{TemplateBinding Padding}"/>
+                        </Border>
+                        <!-- 列分隔线 -->
+                        <Thumb x:Name="PART_RightHeaderGripper"
+                               HorizontalAlignment="Right"
+                               VerticalAlignment="Stretch"
+                               Width="4"
+                               Cursor="SizeWE"
+                               Background="Transparent">
+                            <Thumb.Style>
+                                <Style TargetType="{x:Type Thumb}">
+                                    <Setter Property="Background" Value="Transparent"/>
+                                    <Setter Property="Template">
+                                        <Setter.Value>
+                                            <ControlTemplate TargetType="{x:Type Thumb}">
+                                                <Border Background="{TemplateBinding Background}"
+                                                        Margin="0 1 0 1">
+                                                    <Border Background="{DynamicResource Brush.Border}" 
+                                                            Width="1" 
+                                                            HorizontalAlignment="Center"
+                                                            VerticalAlignment="Stretch"/>
+                                                </Border>
+                                            </ControlTemplate>
+                                        </Setter.Value>
+                                    </Setter>
+                                </Style>
+                            </Thumb.Style>
+                        </Thumb>
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <!-- 列表项样式 -->
+    <Style x:Key="ListView.ListViewItem" TargetType="{x:Type ListViewItem}">
+        <Setter Property="Focusable" Value="True"/>
+        <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}" />
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Padding" Value="5,0"/>
+        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ListViewItem}">
+                    <Border Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            Padding="{TemplateBinding Padding}"
+                            SnapsToDevicePixels="True">
+                        <GridViewRowPresenter Content="{TemplateBinding Content}"
+                                               Columns="{TemplateBinding GridView.ColumnCollection}"
+                                               Margin="{TemplateBinding Padding}"
+                                               VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <!-- 选中状态 -->
+                        <Trigger Property="IsSelected" Value="True">
+                            <Setter Property="Background" Value="{DynamicResource Brush.SelectionSelected}"/>
+                            <Setter Property="Foreground" Value="{DynamicResource Brush.TextContrast}"/>
+                        </Trigger>
+                        <!-- 鼠标悬停 -->
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter Property="Background" Value="{DynamicResource Brush.Overlay48Percent}"/>
+                        </Trigger>
+                        <!-- 交替行背景 -->
+                        <Trigger Property="ItemsControl.AlternationIndex" Value="0">
+                            <Setter Property="Background" Value="{DynamicResource Brush.BodyAlternative}" />
+                        </Trigger>
+                        <Trigger Property="ItemsControl.AlternationIndex" Value="1">
+                            <Setter Property="Background" Value="{DynamicResource Brush.HeaderAlternative}" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <!-- ListView整体模板 -->
+    <ControlTemplate x:Key="Template.ListView" TargetType="{x:Type ListView}">
+        <Border BorderBrush="{TemplateBinding BorderBrush}"
+                BorderThickness="{TemplateBinding BorderThickness}"
+                Background="{TemplateBinding Background}"
+                SnapsToDevicePixels="True">
+            <ScrollViewer x:Name="PART_ScrollViewer"
+                          Focusable="False"
+                          Padding="{TemplateBinding Padding}"
+                          CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
+                          HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
+                          VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
+                          Background="{TemplateBinding Background}"
+                          Style="{DynamicResource ScrollViewer.Default}">
+
+                <DockPanel>
+                    <ContentPresenter DockPanel.Dock="Top"
+                                      x:Name="PART_HeaderPresenter"/>
+                    <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+                </DockPanel>
+            </ScrollViewer>
+        </Border>
+    </ControlTemplate>
+
+    <!-- 主要ListView样式 -->
+    <Style x:Key="ListView.Primary" TargetType="{x:Type ListView}">
+        <Setter Property="Background" Value="{DynamicResource Brush.TextContrast}" />
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="SnapsToDevicePixels" Value="True"/>
+        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}"/>
+        <Setter Property="BorderThickness" Value="1"/>
+        <Setter Property="Padding" Value="0"/>
+        <Setter Property="AlternationCount" Value="2"/>
+        <Setter Property="ItemContainerStyle" Value="{DynamicResource ListView.ListViewItem}"/>
+        <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
+        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
+        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ListView}">
+                    <Border BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            Background="{TemplateBinding Background}"
+                            Padding="{TemplateBinding Padding}">
+                        <!--<Grid>
+                            <Grid.RowDefinitions>
+                                <RowDefinition Height="Auto"/>
+                                <RowDefinition Height="*"/>
+                            </Grid.RowDefinitions>
+                            <ContentPresenter Grid.Row="0"
+                                              Margin="0"/>-->
+
+                            <!-- 内容区域 -->
+                            <!--<ScrollViewer Grid.Row="1"
+                                          x:Name="PART_ScrollViewer"
+                                          Focusable="False"
+                                          CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
+                                          HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
+                                          VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
+                                          Background="{TemplateBinding Background}"
+                                          Style="{DynamicResource ScrollViewer.Default}">
+                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+                                                Margin="{TemplateBinding Padding}"/>
+                            </ScrollViewer>-->
+                        <!--</Grid>-->
+                            <DockPanel>
+                                <ContentPresenter DockPanel.Dock="Top" x:Name="PART_HeaderPresenter"/>
+                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+                            </DockPanel>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <!-- 无列头版本 -->
+    <Style x:Key="ListView.Primary.NoHeader" TargetType="{x:Type ListView}" BasedOn="{StaticResource ListView.Primary}">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ListView}">
+                    <Border BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            Background="{TemplateBinding Background}"
+                            Padding="{TemplateBinding Padding}">
+                        <ScrollViewer x:Name="PART_ScrollViewer"
+                                      Focusable="False"
+                                      CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
+                                      HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
+                                      VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
+                                      Background="{TemplateBinding Background}"
+                                      Style="{DynamicResource ScrollViewer.Default}">
+                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+                                            Margin="{TemplateBinding Padding}"/>
+                        </ScrollViewer>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <!--无边框版本-->
+    <Style x:Key="ListView.Primary.NoBorder" TargetType="{x:Type ListView}" BasedOn="{StaticResource ListView.Primary}">
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Background" Value="Transparent"/>
+    </Style>
+
+    <Style x:Key="ListView.ListViewItem.Colored" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListView.ListViewItem}">
+        <Style.Triggers>
+            <Trigger Property="IsSelected" Value="True">
+                <Setter Property="Background" Value="{DynamicResource Brush.SelectionSelectedBackground}"/>
+                <Setter Property="Foreground" Value="White"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+
+    <!-- 定义颜色资源 -->
+    <SolidColorBrush x:Key="HeaderBackground" Color="#2C3E50"/>
+    <SolidColorBrush x:Key="HeaderForeground" Color="White"/>
+    <SolidColorBrush x:Key="RowHoverBackground" Color="#EBF5FB"/>
+    <SolidColorBrush x:Key="RowSelectedBackground" Color="#5DADE2"/>
+    <SolidColorBrush x:Key="RowSelectedForeground" Color="White"/>
+    <SolidColorBrush x:Key="AlternateRowBackground" Color="#F4F6F7"/>
+    <SolidColorBrush x:Key="NormalRowBackground" Color="White"/>
+    <SolidColorBrush x:Key="GridLineBrush" Color="#BDC3C7"/>
+
+    <!-- ListViewItem 样式 -->
+    <Style x:Key="CustomListViewItemStyle" TargetType="ListViewItem">
+        <Setter Property="Background" Value="{StaticResource NormalRowBackground}"/>
+        <Setter Property="Foreground" Value="#2C3E50"/>
+        <Setter Property="FontSize" Value="13"/>
+        <Setter Property="Height" Value="35"/>
+        <Setter Property="BorderThickness" Value="0,0,0,1"/>
+        <Setter Property="BorderBrush" Value="{StaticResource GridLineBrush}"/>
+        <Setter Property="Cursor" Value="Hand"/>
+
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="ListViewItem">
+                    <Border x:Name="Bd"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        Padding="10,5">
+                        <ContentPresenter HorizontalAlignment="Left"
+                                    VerticalAlignment="Center"/>
+                    </Border>
+
+                    <ControlTemplate.Triggers>
+                        <!-- 悬停效果 -->
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="Bd" Property="Background" 
+                                Value="{StaticResource RowHoverBackground}"/>
+                        </Trigger>
+
+                        <!-- 选中效果 -->
+                        <Trigger Property="IsSelected" Value="True">
+                            <Setter TargetName="Bd" Property="Background" 
+                                Value="{StaticResource RowSelectedBackground}"/>
+                            <Setter Property="Foreground" 
+                                Value="{StaticResource RowSelectedForeground}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <!-- 交替行背景样式 -->
+    <Style x:Key="AlternatingListViewItemStyle" 
+       BasedOn="{StaticResource CustomListViewItemStyle}" 
+       TargetType="ListViewItem">
+        <Style.Triggers>
+            <Trigger Property="ItemsControl.AlternationIndex" Value="0">
+                <Setter Property="Background" Value="{StaticResource NormalRowBackground}"/>
+            </Trigger>
+            <Trigger Property="ItemsControl.AlternationIndex" Value="1">
+                <Setter Property="Background" Value="{StaticResource AlternateRowBackground}"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+
+    <!-- GridView列标题样式 - 修复版 -->
+    <Style x:Key="CustomGridViewColumnHeader" TargetType="GridViewColumnHeader">
+        <Setter Property="Background" Value="{StaticResource HeaderBackground}"/>
+        <Setter Property="Foreground" Value="{StaticResource HeaderForeground}"/>
+        <Setter Property="Height" Value="40"/>
+        <Setter Property="FontSize" Value="13"/>
+        <Setter Property="FontWeight" Value="Bold"/>
+        <Setter Property="BorderThickness" Value="0,0,1,0"/>
+        <Setter Property="BorderBrush" Value="#34495E"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="HorizontalContentAlignment" Value="Left"/>
+        <Setter Property="Padding" Value="10,0"/>
+
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="GridViewColumnHeader">
+                    <Grid>
+                        <Border x:Name="HeaderBorder"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            Padding="{TemplateBinding Padding}">
+
+                            <Grid>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="*"/>
+                                    <ColumnDefinition Width="Auto"/>
+                                </Grid.ColumnDefinitions>
+
+                                <!-- 使用ContentControl替代ContentPresenter,更可靠 -->
+                                <ContentControl x:Name="HeaderContent"
+                                            Grid.Column="0"
+                                            Content="{TemplateBinding Content}"
+                                            ContentTemplate="{TemplateBinding ContentTemplate}"
+                                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                            VerticalAlignment="Center"
+                                            Foreground="{TemplateBinding Foreground}"
+                                            FontWeight="{TemplateBinding FontWeight}"
+                                            FontSize="{TemplateBinding FontSize}"/>
+
+                                <!-- 排序指示器 -->
+                                <Path x:Name="SortIndicator"
+                                  Grid.Column="1"
+                                  Width="10"
+                                  Height="10"
+                                  Margin="8,0,0,0"
+                                  Fill="{TemplateBinding Foreground}"
+                                  Visibility="Collapsed"
+                                  Data="M0,8 L5,0 L10,8 Z"
+                                  Stretch="Fill"/>
+                            </Grid>
+                        </Border>
+
+                        <!-- 列分隔线 -->
+                        <Rectangle x:Name="Splitter"
+                               Grid.Column="0"
+                               Width="1"
+                               HorizontalAlignment="Right"
+                               VerticalAlignment="Stretch"
+                               Fill="{StaticResource GridLineBrush}"
+                               Visibility="Hidden"/>
+                    </Grid>
+
+                    <ControlTemplate.Triggers>
+                        <!-- 隐藏内边距列 -->
+                        <Trigger Property="Role" Value="Padding">
+                            <Setter Property="Visibility" Value="Collapsed"/>
+                        </Trigger>
+
+                        <!-- 悬停效果 -->
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="HeaderBorder" Property="Background" Value="#34495E"/>
+                        </Trigger>
+
+                        <!-- 按下效果 -->
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="HeaderBorder" Property="Background" Value="#1A252F"/>
+                        </Trigger>
+
+                        <!-- 显示排序指示器 -->
+                        <Trigger SourceName="SortIndicator" Property="Visibility" Value="Visible">
+                            <Setter TargetName="HeaderContent" Property="Margin" Value="0,0,20,0"/>
+                        </Trigger>
+
+                        <!-- 列分隔线显示 -->
+                        <MultiTrigger>
+                            <MultiTrigger.Conditions>
+                                <Condition Property="IsMouseOver" Value="True"/>
+                                <Condition Property="Role" Value="Normal"/>
+                            </MultiTrigger.Conditions>
+                            <Setter TargetName="Splitter" Property="Visibility" Value="Visible"/>
+                        </MultiTrigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <!-- 主ListView样式 -->
+    <Style x:Key="CustomListViewStyle" TargetType="ListView">
+        <Setter Property="Background" Value="White"/>
+        <Setter Property="BorderBrush" Value="#BDC3C7"/>
+        <Setter Property="BorderThickness" Value="1"/>
+        <Setter Property="FontFamily" Value="Segoe UI"/>
+        <Setter Property="AlternationCount" Value="2"/>
+        <Setter Property="ItemContainerStyle" 
+            Value="{StaticResource AlternatingListViewItemStyle}"/>
+
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="ListView">
+                    <Border Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        CornerRadius="4">
+                        <ScrollViewer>
+                            <ItemsPresenter/>
+                        </ScrollViewer>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 3 - 1
SKMC.UI/Styles/RadioButton.xaml

@@ -107,6 +107,7 @@
         <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
         <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
         <Setter Property="HorizontalContentAlignment" Value="Center"/>
         <Setter Property="HorizontalContentAlignment" Value="Center"/>
         <Setter Property="VerticalContentAlignment" Value="Center"/>
         <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="BorderThickness" Value="0"/>
         <Setter Property="Cursor" Value="Hand"/>
         <Setter Property="Cursor" Value="Hand"/>
         <Setter Property="FontWeight" Value="Normal"/>
         <Setter Property="FontWeight" Value="Normal"/>
         <Setter Property="FontSize" Value="{DynamicResource FontSize.Callout}"/>
         <Setter Property="FontSize" Value="{DynamicResource FontSize.Callout}"/>
@@ -117,7 +118,8 @@
                 <ControlTemplate TargetType="{x:Type RadioButton}">
                 <ControlTemplate TargetType="{x:Type RadioButton}">
                     <Border x:Name="menuButton"  
                     <Border x:Name="menuButton"  
                             Background="{TemplateBinding Background}" 
                             Background="{TemplateBinding Background}" 
-                            BorderThickness="{TemplateBinding BorderThickness}">
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            BorderBrush="{TemplateBinding BorderBrush}">
                         <TextBlock x:Name="txtName" 
                         <TextBlock x:Name="txtName" 
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"

+ 35 - 0
SKMC.UI/Styles/TapItem.xaml

@@ -0,0 +1,35 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    
+    <Style x:Key="TapItem.Primary" TargetType="{x:Type TabItem}">
+        <Setter Property="Background" Value="{DynamicResource Brush.PreviewBackground}"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Callout}"/>
+        <!--<Setter Property="Padding" Value="1"/>-->
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type TabItem}">
+                    <Border Name="Border"
+                            Background="{TemplateBinding Background}" 
+                            BorderBrush="{TemplateBinding BorderBrush}" 
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            Cursor="Hand">
+                        <ContentPresenter Name="ContentSite"
+                                          VerticalAlignment="Center"
+                                          HorizontalAlignment="Center"
+                                          ContentSource="Header"
+                                          Margin="10 5 10 5"/>
+                    </Border>
+                    
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsSelected" Value="True">
+                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource Brush.SelectionSelectedBackground}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 3 - 0
SKMC.UI/Styles/TextBlock.xaml

@@ -4,5 +4,8 @@
         <Setter Property="FontSize" Value="{DynamicResource FontSize.Callout}"/>
         <Setter Property="FontSize" Value="{DynamicResource FontSize.Callout}"/>
         <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
         <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
         <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
         <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="FontWeight" Value="Bold"/>
+        <Setter Property="HorizontalAlignment" Value="Center"/>
+        <Setter Property="VerticalAlignment" Value="Center"/>
     </Style>
     </Style>
 </ResourceDictionary>
 </ResourceDictionary>

+ 32 - 0
SKMC.UI/Styles/ToggleButton.xaml

@@ -131,4 +131,36 @@
             </Setter.Value>
             </Setter.Value>
         </Setter>
         </Setter>
     </Style>
     </Style>
+    <!--主题切换按钮-->
+    <Style x:Key="ToggleButton.ThemeSwitch" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource ToggleButton.Base}">
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Width" Value="45"/>
+        <Setter Property="Height" Value="45"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border BorderBrush="{TemplateBinding BorderBrush}"
+                            Background="{TemplateBinding Background}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                        <Path Width="{TemplateBinding FontSize}"
+                              Height="{TemplateBinding FontSize}"
+                              Stretch="Uniform"
+                              x:Name="theme"
+                              Margin="5"/>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsChecked" Value="False">
+                            <Setter TargetName="theme" Property="Data" Value="{DynamicResource Icon.Sun}"/>
+                            <Setter TargetName="theme" Property="Fill" Value="{DynamicResource Brush.Text}"/>
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="theme" Property="Data" Value="{DynamicResource Icon.Moon}"/>
+                            <Setter TargetName="theme" Property="Fill" Value="{DynamicResource Brush.Text}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 </ResourceDictionary>
 </ResourceDictionary>

+ 1 - 1
SKMC.UI/Themes/Dark.xaml

@@ -30,7 +30,7 @@
     <SolidColorBrush x:Key="Brush.ButtonTextDisabled" Opacity="0.30" Color="{DynamicResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.ButtonTextDisabled" Opacity="0.30" Color="{DynamicResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.ButtonHover" Opacity="0.2" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.ButtonHover" Opacity="0.2" Color="{DynamicResource Color.Signature}" />
 
 
-    <SolidColorBrush x:Key="Brush.PrimaryButton" Color="{DynamicResource Color.Signature}" />
+    <SolidColorBrush x:Key="Brush.PrimaryButton" Opacity="0.5" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonPressed" Color="{DynamicResource Color.SignatureDark}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonPressed" Color="{DynamicResource Color.SignatureDark}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonDisabled" Opacity="0.5" Color="{DynamicResource Color.SignatureDark}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonDisabled" Opacity="0.5" Color="{DynamicResource Color.SignatureDark}" />

+ 1 - 1
SKMC.UI/Themes/Light.xaml

@@ -36,7 +36,7 @@
     <SolidColorBrush x:Key="Brush.ButtonTextDisabled" Opacity="0.30" Color="{DynamicResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.ButtonTextDisabled" Opacity="0.30" Color="{DynamicResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.ButtonHover" Opacity="0.2" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.ButtonHover" Opacity="0.2" Color="{DynamicResource Color.Signature}" />
 
 
-    <SolidColorBrush x:Key="Brush.PrimaryButton" Color="{DynamicResource Color.Signature}" />
+    <SolidColorBrush x:Key="Brush.PrimaryButton" Opacity="0.5" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Signature}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonPressed" Color="{DynamicResource Color.SignatureDark}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonPressed" Color="{DynamicResource Color.SignatureDark}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonDisabled" Opacity="0.5" Color="{DynamicResource Color.SignatureDark}" />
     <SolidColorBrush x:Key="Brush.PrimaryButtonDisabled" Opacity="0.5" Color="{DynamicResource Color.SignatureDark}" />

+ 30 - 0
SKMC.UI/ValidationRules/DateTimeRule.cs

@@ -0,0 +1,30 @@
+using SKMC.UI.Converters;
+using System;
+using System.Globalization;
+using System.Windows.Controls;
+
+namespace SKMC.UI.ValidationRules
+{
+    public class DateTimeRule : ValidationRule
+    {
+        private readonly DateTimeToStringConverter dateTimeToStringConverter;
+
+        public DateTimeRule()
+        {
+            dateTimeToStringConverter = new DateTimeToStringConverter();
+        }
+
+        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
+        {
+            try
+            {
+                dateTimeToStringConverter.ConvertBack(value, typeof(DateTime), null, cultureInfo);
+                return ValidationResult.ValidResult;
+            }
+            catch (Exception)
+            {
+                return new ValidationResult(isValid: false, $"The value of {"value"} ({value}) cannot be parsed as the type {typeof(DateTime).Name}!");
+            }
+        }
+    }
+}

+ 80 - 0
SKMC.UI/ValidationRules/RangeValidationRule.cs

@@ -0,0 +1,80 @@
+using System.Globalization;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace SKMC.UI.ValidationRules
+{
+    // 依赖属性代理类,继承自DependencyObject以支持绑定
+    public class RangeValidationProxy : Freezable
+    {
+        // 最小值依赖属性
+        public double Minimum
+        {
+            get { return (double)GetValue(MinimumProperty); }
+            set { SetValue(MinimumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MinimumProperty =
+            DependencyProperty.Register("Minimum", typeof(double), typeof(RangeValidationProxy), new PropertyMetadata(0.0));
+
+        // 最大值依赖属性
+        public double Maximum
+        {
+            get { return (double)GetValue(MaximumProperty); }
+            set { SetValue(MaximumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MaximumProperty =
+            DependencyProperty.Register("Maximum", typeof(double), typeof(RangeValidationProxy), new PropertyMetadata(100.0));
+
+        // 是否允许为空依赖属性
+        public bool AllowEmpty
+        {
+            get { return (bool)GetValue(AllowEmptyProperty); }
+            set { SetValue(AllowEmptyProperty, value); }
+        }
+
+        public static readonly DependencyProperty AllowEmptyProperty =
+            DependencyProperty.Register("AllowEmpty", typeof(bool), typeof(RangeValidationProxy), new PropertyMetadata(false));
+        // Freezable必需的实现
+        protected override Freezable CreateInstanceCore()
+        {
+            return new RangeValidationProxy();
+        }
+    }
+    public class RangeValidationRule : ValidationRule
+    {
+        // 使用依赖属性代理类来支持绑定
+        public RangeValidationProxy Proxy { get; set; } = new RangeValidationProxy();
+        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
+        {
+            // 使用代理类中的值进行验证
+            var minimum = Proxy.Minimum;
+            var maximum = Proxy.Maximum;
+            var allowEmpty = Proxy.AllowEmpty;
+            string input = value?.ToString() ?? string.Empty;
+
+            // 处理空值情况
+            if (string.IsNullOrWhiteSpace(input))
+            {
+                return allowEmpty
+                    ? ValidationResult.ValidResult
+                    : new ValidationResult(false, "输入不能为空");
+            }
+
+            // 验证是否为有效数字
+            if (!double.TryParse(input, out double number))
+            {
+                return new ValidationResult(false, "请输入有效的数字");
+            }
+
+            // 验证是否在范围内
+            if (number < minimum || number > maximum)
+            {
+                return new ValidationResult(false, $"请输入{minimum}到{maximum}之间的数字");
+            }
+
+            return ValidationResult.ValidResult;
+        }
+    }
+}