Ver código fonte

SKCM.UI库初步设计完成

Jiangsheng 1 mês atrás
pai
commit
8d8d057f78

+ 3 - 0
SKMC.UI/Assets/Brushes.xaml

@@ -1,5 +1,6 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <!--公共画刷,不随主题切换-->
     <SolidColorBrush x:Key="Brush.MachineControls" Color="{DynamicResource Color.MachineControls}" />
     <SolidColorBrush x:Key="Brush.Overlay2Percent" Opacity="0.02" Color="{DynamicResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.Overlay3Percent" Opacity="0.03" Color="{DynamicResource Color.Overlay}" />
@@ -37,6 +38,8 @@
     <SolidColorBrush x:Key="Brush.SecondaryFont" Opacity="0.6" Color="{DynamicResource Color.Text}" />
     <SolidColorBrush x:Key="Brush.Annotation" Color="DarkViolet" />
     <SolidColorBrush x:Key="Brush.TextSecondColor" Color="Yellow" />
+    <SolidColorBrush x:Key="Brush.DebugText" Color="White" />
+    <SolidColorBrush x:Key="Brush.DebugTextOver" Opacity="0.5" Color="White" />
     
     <SolidColorBrush x:Key="Brush.RgbRed" Color="{DynamicResource Color.Error}" />
     <SolidColorBrush x:Key="Brush.RgbGreen" Color="{DynamicResource Color.RgbGreen}" />

+ 1 - 0
SKMC.UI/Assets/Colors.xaml

@@ -1,5 +1,6 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <!--基础颜色/公共颜色-->
     <Color x:Key="Color.Neutral">#545454</Color>
     <Color x:Key="Color.Error">#FF191C</Color>
     <Color x:Key="Color.Warning">#FCB000</Color>

+ 1 - 0
SKMC.UI/Assets/Font.xaml

@@ -1,6 +1,7 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                     xmlns:system="clr-namespace:System;assembly=mscorlib">
+    <!--全局字体字号-->
     <FontFamily x:Key="FontFamily.Global">Arial</FontFamily>
     <system:Double x:Key="FontSize.Headline">21</system:Double>
     <system:Double x:Key="FontSize.Callout">18</system:Double>

+ 9 - 2
SKMC.UI/Assets/Icons.xaml

@@ -3,6 +3,7 @@
     <ResourceDictionary.MergedDictionaries>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Assets/Brushes.xaml"/>
     </ResourceDictionary.MergedDictionaries>
+    <!--Icon几何图形-->
     <GeometryGroup x:Key="Icon.Production">
         <PathGeometry Figures="M15.95 17.958H2.857c-1.052 0-1.905-.853-1.905-1.905V2.857c0-1.051.853-1.905 1.905-1.905H15.95c1.053 0 1.905.854 1.905 1.905v13.196c0 1.052-.852 1.905-1.905 1.905zM15.95 39.048H2.857c-1.052 0-1.905-.853-1.905-1.905V23.947c0-1.051.853-1.905 1.905-1.905H15.95c1.053 0 1.905.854 1.905 1.905v13.196c0 1.052-.852 1.905-1.905 1.905zM37.142 39.048H24.05c-1.053 0-1.905-.853-1.905-1.905V2.858c0-1.052.852-1.905 1.905-1.905h13.093c1.054 0 1.905.853 1.905 1.905v34.285c0 1.052-.851 1.905-1.905 1.905z" />
     </GeometryGroup>
@@ -254,7 +255,7 @@
             </GeometryGroup.Transform>
         </GeometryGroup>
     </GeometryGroup>
-    <GeometryGroup x:Key="Icon.Close">
+    <!--<GeometryGroup x:Key="Icon.Close">
         <GeometryGroup>
             <PathGeometry Figures="M0 16.8L35.2 16.8" />
             <GeometryGroup.Transform>
@@ -270,7 +271,13 @@
                 </TransformGroup>
             </GeometryGroup.Transform>
         </GeometryGroup>
-    </GeometryGroup>
+    </GeometryGroup>-->
+    <PathGeometry x:Key="Icon.Close" Figures="M13.41 12l4.3-4.29a1 1 0 1 0-1.42-1.42L12 10.59l-4.29-4.3a1 1 0 0 0-1.42 1.42l4.3 4.29-4.3 4.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l4.29-4.3 4.29 4.3a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42z"/>
+    <PathGeometry x:Key="Icon.Minimize" Figures="M19 13H5a1 1 0 0 1 0-2h14a1 1 0 0 1 0 2z"/>
+    <PathGeometry x:Key="Icon.Maximize" Figures="M18 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3zM6 5a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1z"/>
+    <!--<PathGeometry x:Key="restore" Figures="M18 3H6a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3zm1 15a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1z M15 11H9a1 1 0 0 0 0 2h6a1 1 0 0 0 0-2z"/>-->
+    <PathGeometry x:Key="Icon.Restore" Figures="M795.5 230.6v727.2H64V230.6h731.5z m-82.2 78H146.2V880h567V308.6zM228.5 66.2H960v731.5H795.5v-82.2h82.2V148.4h-567v82.2h-82.2V66.2z"/>
+
     <GeometryGroup x:Key="Icon.WarningCircle">
         <GeometryGroup>
             <GeometryGroup.Transform>

+ 13 - 7
SKMC.UI/Assets/Storyboards.xaml

@@ -1,9 +1,12 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:sys="clr-namespace:System;assembly=mscorlib">
-    
-    <!--<Storyboard x:Key="Storyboard.Blinking">
-        <DoubleAnimationUsingKeyFrames AutoReverse="True" RepeatBehavior="Forever" TargetProperty="Opacity" Duration="0:0:1">
+    <!--故事板-闪烁-->
+    <Storyboard x:Key="Storyboard.Blinking">
+        <DoubleAnimationUsingKeyFrames AutoReverse="True" 
+                                       RepeatBehavior="Forever" 
+                                       Storyboard.TargetProperty="Opacity" 
+                                       Duration="0:0:1">
             <DoubleAnimationUsingKeyFrames.KeyFrames>
                 <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0.0" />
                 <DiscreteDoubleKeyFrame KeyTime="0:0:0.5" Value="1.0" />
@@ -11,8 +14,11 @@
             </DoubleAnimationUsingKeyFrames.KeyFrames>
         </DoubleAnimationUsingKeyFrames>
     </Storyboard>
+    <!--故事板-背景闪烁-->
     <Storyboard x:Key="Storyboard.BackgroundBlinking">
-        <ObjectAnimationUsingKeyFrames RepeatBehavior="Forever" TargetProperty="Background" Duration="0:0:2">
+        <ObjectAnimationUsingKeyFrames RepeatBehavior="Forever" 
+                                       Storyboard.TargetProperty="Background" 
+                                       Duration="0:0:2">
             <ObjectAnimationUsingKeyFrames.KeyFrames>
                 <DiscreteObjectKeyFrame KeyTime="0:0:1">
                     <DiscreteObjectKeyFrame.Value>
@@ -21,12 +27,12 @@
                 </DiscreteObjectKeyFrame>
             </ObjectAnimationUsingKeyFrames.KeyFrames>
         </ObjectAnimationUsingKeyFrames>
-    </Storyboard>-->
+    </Storyboard>
     
     <Storyboard x:Key="Storyboard.Runtime">
         <ObjectAnimationUsingKeyFrames Duration="0:0:2"
-                                       Storyboard.TargetProperty="DataContext" 
-                                       RepeatBehavior="Forever">
+                                       RepeatBehavior="Forever"
+                                       Storyboard.TargetProperty="DataContext">
             <DiscreteObjectKeyFrame Value="{x:Static sys:DateTime.Now}" KeyTime="0:0:0"/>
             <DiscreteObjectKeyFrame Value="{x:Static sys:DateTime.Now}" KeyTime="0:0:1"/>
         </ObjectAnimationUsingKeyFrames>

+ 1 - 0
SKMC.UI/FrameWork.xaml

@@ -22,6 +22,7 @@
         <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"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/ComboBox.xaml"/>
         <!--Styles-->
     </ResourceDictionary.MergedDictionaries>
 </ResourceDictionary>

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

@@ -32,6 +32,7 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="PresentationFramework.Aero2" />
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
@@ -118,6 +119,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\ComboBox.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\DatePicker.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 87 - 0
SKMC.UI/Styles/Button.xaml

@@ -143,4 +143,91 @@
             </Setter.Value>
         </Setter>
     </Style>
+    <!--调试按钮-->
+    <Style x:Key="Button.Debug" TargetType="{x:Type Button}" BasedOn="{StaticResource Button.Base}">
+        <Setter Property="Foreground" Value="{DynamicResource Brush.DebugText}"/>
+        <Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Foreground" Value="{DynamicResource Brush.DebugTextOver}"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+    <!--窗体控制按钮-最大化/最小化-->
+    <Style x:Key="Button.WindowControl" TargetType="{x:Type Button}">
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Height" Value="25"/>
+        <Setter Property="Width" Value="25"/>
+        <Setter Property="Padding" Value="5"/>
+        <!--<Setter Property="Margin" Value="5"/>-->
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border Name="bd" CornerRadius="5" Background="{TemplateBinding Background}" 
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                        <Path Name="ico" Data="{TemplateBinding Content}" 
+                              Fill="{TemplateBinding Foreground}" 
+                              Height="15" Width="15" Stretch="Uniform" 
+                              Margin="{TemplateBinding Padding}"/>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter Property="Background" Value="{DynamicResource Brush.ButtonHover}"/>
+                        </Trigger>
+                        <MultiTrigger>
+                            <MultiTrigger.Conditions>
+                                <Condition Property="IsMouseOver" Value="True"/>
+                                <Condition Property="Tag" Value="IsCloseButton"/>
+                            </MultiTrigger.Conditions>
+                            <Setter Property="Background" Value="#F72626"/>
+                            <Setter TargetName="ico" Property="Fill" Value="{DynamicResource Brush.ButtonHover}"/>
+                        </MultiTrigger>
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="ico" Property="Fill" Value="{DynamicResource Brush.ButtonPressed}"/>
+                        </Trigger>
+                        <!--<Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="bd" Property="Background" Value="{DynamicResource TertiaryBackgroundColor}"></Setter>
+                        </Trigger>-->
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <Style x:Key="Button.SimpleIcon" TargetType="{x:Type Button}">
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="Background" Value="{DynamicResource Brush.PrimaryButton}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="Margin" Value="2"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border Width="{TemplateBinding Width}"
+                            Height="{TemplateBinding Height}"
+                            Background="{TemplateBinding Background}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                        <Path Data="{TemplateBinding Content}"
+                              Stroke="{TemplateBinding Foreground}"
+                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                              Width="{TemplateBinding FontSize}"
+                              Height="{TemplateBinding FontSize}"
+                              Margin="{TemplateBinding Padding}"
+                              Stretch="Uniform"/>
+                    </Border>
+
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Background" Value="{DynamicResource Brush.Signature}"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
 </ResourceDictionary>

+ 46 - 126
SKMC.UI/Styles/Calendar.xaml

@@ -1,8 +1,6 @@
 <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>
     <!--年-->
@@ -28,48 +26,19 @@
                         <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>
+                                          TextElement.Foreground="#FFFFFF" />
                     </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="Background" Property="Opacity" Value="0.5"/>
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="Background" Property="Opacity" Value="0.5"/>
+                        </Trigger>
+                        <Trigger Property="IsInactive" Value="True">
+                            <Setter TargetName="NormalText" Property="TextElement.Foreground" Value="#FF777777"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
                 </ControlTemplate>
             </Setter.Value>
         </Setter>
@@ -77,7 +46,7 @@
         <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" />
@@ -101,7 +70,7 @@
                         <ContentPresenter Name="NormalText" Margin="5,1,5,1" 
                                           HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" 
                                           VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
-                                          TextElement.Foreground="{DynamicResource Brush.Text}" />
+                                          TextElement.Foreground="#FFFFFF" />
                         <Path Name="Blackout" Margin="3" 
                               HorizontalAlignment="Stretch" 
                               VerticalAlignment="Stretch" 
@@ -109,81 +78,32 @@
                               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.Triggers>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="HighlightBackground" Property="Opacity" Value="0"/>
+                            <Setter TargetName="NormalText" Property="Opacity" Value="0.35"/>
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="HighlightBackground" Property="Opacity" Value="0.5"/>
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="HighlightBackground" Property="Opacity" Value="0.5"/>
+                        </Trigger>
+                        <Trigger Property="IsSelected" Value="True">
+                            <Setter TargetName="SelectedBackground" Property="Opacity" Value="0.75"/>
+                        </Trigger>
+                        <Trigger Property="IsInactive" Value="True">
+                            <Setter TargetName="NormalText" Property="TextElement.Foreground" Value="#FFFFFFFF"/>
+                        </Trigger>
+                        <Trigger Property="IsToday" Value="True">
+                            <Setter TargetName="TodayBackground" Property="Opacity" Value="1"/>
+                            <Setter TargetName="NormalText" Property="TextElement.Foreground" Value="#FFFFFFFF"/>
+                        </Trigger>
+                        <Trigger Property="IsBlackedOut" Value="True">
+                            <Setter TargetName="Blackout" Property="Opacity" Value="0.2"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
                 </ControlTemplate>
             </Setter.Value>
         </Setter>
@@ -204,7 +124,7 @@
                                 <TextBlock Margin="0,6,0,6" HorizontalAlignment="Center" VerticalAlignment="Center" 
                                            FontFamily="Arial" 
                                            FontSize="16" 
-                                           Foreground="{DynamicResource Brush.Text}" 
+                                           Foreground="#FFFFFF" 
                                            Text="{Binding}" />
                             </DataTemplate>
                         </ResourceDictionary>
@@ -229,14 +149,14 @@
                                                                   VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" 
                                                                   Content="{TemplateBinding ContentControl.Content}" 
                                                                   ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" 
-                                                                  TextElement.Foreground="{DynamicResource Brush.Text}" />
+                                                                  TextElement.Foreground="#FFFFFF" />
                                             </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}" />
+                                                    <Setter TargetName="buttonContent" Property="TextElement.Foreground" Value="#FFFFFF" />
                                                 </Trigger>
                                                 <Trigger Property="IsEnabled" Value="False">
                                                     <Setter TargetName="buttonContent" Property="Opacity" Value=".5" />
@@ -262,7 +182,7 @@
                                     <Path Width="16" Height="16" StrokeThickness="2" 
                                           Data="{StaticResource Icon.ChevronLeft}"
                                           Stretch="Uniform"
-                                          Stroke="{DynamicResource Brush.Icon}"/>
+                                          Stroke="#FFFFFF"/>
                                     <Button.Style>
                                         <Style TargetType="{x:Type Button}">
                                             <Setter Property="Width" Value="48"/>
@@ -270,7 +190,7 @@
                                             <Setter Property="HorizontalAlignment" Value="Left"/>
                                             <Setter Property="VerticalAlignment" Value="Center"/>
                                             <Setter Property="Focusable" Value="False"/>
-                                            <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+                                            <Setter Property="Foreground" Value="#FFFFFF"/>
                                             <Setter Property="Background" Value="{DynamicResource Brush.SecondaryButton}"/>
                                             <Setter Property="BorderThickness" Value="0"/>
                                             <Setter Property="Cursor" Value="Hand"/>
@@ -305,7 +225,7 @@
                                     <Path Width="16" Height="16" 
                                           StrokeThickness="2" 
                                           Data="{StaticResource Icon.ChevronRight}"
-                                          Stroke="{DynamicResource Brush.Icon}"
+                                          Stroke="#FFFFFF"
                                           Stretch="Uniform"/>
                                     <Button.Style>
                                         <Style TargetType="{x:Type Button}">
@@ -404,7 +324,7 @@
     <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="Background" Value="#161616" />
         <Setter Property="Calendar.CalendarButtonStyle" Value="{StaticResource Calendar.CalendarButton}" />
         <Setter Property="Calendar.CalendarDayButtonStyle" Value="{StaticResource Calendar.DayButton}" />
         <Setter Property="Template">

+ 160 - 0
SKMC.UI/Styles/ComboBox.xaml

@@ -0,0 +1,160 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2">
+    <!--下拉框样式-->
+    <Style x:Key="ComboBox.FocusVisual">
+        <Setter Property="Control.Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Rectangle Margin="2" StrokeDashArray="1 2" 
+                               Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" 
+                               SnapsToDevicePixels="true" 
+                               StrokeThickness="1"/>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <!--下拉框Toggle按钮-->
+    <Style x:Key="ComboBox.ToggleButton" TargetType="{x:Type ToggleButton}">
+        <Setter Property="OverridesDefaultStyle" Value="true"/>
+        <Setter Property="IsTabStop" Value="false"/>
+        <Setter Property="Focusable" Value="false"/>
+        <Setter Property="ClickMode" Value="Press"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border x:Name="templateRoot" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
+                        <Border x:Name="splitBorder"
+                                BorderThickness="1" 
+                                HorizontalAlignment="Right" 
+                                Margin="0" SnapsToDevicePixels="true" 
+                                Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
+                            <Path x:Name="arrow" 
+                                  Data="{DynamicResource Icon.CaretDown}" 
+                                  Fill="{DynamicResource Brush.Icon}" 
+                                  Stretch="Uniform"
+                                  HorizontalAlignment="Center"
+                                  VerticalAlignment="Center"
+                                  Margin="2"/>
+                        </Border>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="arrow" Property="Fill"  Value="{DynamicResource Brush.IconInactive}"/>
+                            <!--<Setter TargetName="templateRoot" Property="Background"  Value="{DynamicResource Brush.Background}"/>-->
+                            <Setter TargetName="templateRoot" Property="BorderBrush" Value="{DynamicResource Brush.Signature}"/>
+                            <!--<Setter TargetName="splitBorder" Property="BorderBrush" Value="{DynamicResource Brush.SignatureDark}"/>-->
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter Property="Fill" TargetName="arrow" Value="{DynamicResource Brush.ButtonTextDisabled}"/>
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="arrow" Property="Data" Value="{DynamicResource Icon.CaretUp}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <!--下拉框控件模板-->
+    <ControlTemplate x:Key="ComboBox.Template" TargetType="{x:Type ComboBox}">
+        <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"/>
+                <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" 
+                                  Width="0"/>
+            </Grid.ColumnDefinitions>
+            <Popup x:Name="PART_Popup" 
+                   AllowsTransparency="true"
+                   IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" 
+                   Margin="1" Placement="Bottom" 
+                   PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
+                <theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" MaxHeight="{TemplateBinding MaxDropDownHeight}">
+                    <Border x:Name="dropDownBorder" 
+                            Background="{DynamicResource Brush.DarkBackground}" 
+                            BorderBrush="{DynamicResource Brush.Border}" 
+                            BorderThickness="1">
+                        <ScrollViewer x:Name="DropDownScrollViewer" 
+                                    Style="{DynamicResource ScrollViewer.Default}">
+                            <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
+                                <Canvas x:Name="canvas" 
+                                        HorizontalAlignment="Left" 
+                                        Height="0" 
+                                        VerticalAlignment="Top" 
+                                        Width="0">
+                                    <Rectangle x:Name="opaqueRect" 
+                                               Fill="{Binding Background, ElementName=dropDownBorder}" 
+                                               Height="{Binding ActualHeight, ElementName=dropDownBorder}" 
+                                               Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
+                                </Canvas>
+                                <ItemsPresenter x:Name="ItemsPresenter" 
+                                                KeyboardNavigation.DirectionalNavigation="Contained" 
+                                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+                            </Grid>
+                        </ScrollViewer>
+                    </Border>
+                </theme:SystemDropShadowChrome>
+            </Popup>
+            <ToggleButton x:Name="toggleButton" 
+                          Background="{TemplateBinding Background}" 
+                          BorderBrush="{TemplateBinding BorderBrush}" 
+                          BorderThickness="{TemplateBinding BorderThickness}" 
+                          Grid.ColumnSpan="2" 
+                          IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" 
+                          Style="{StaticResource ComboBox.ToggleButton}"/>
+            <ContentPresenter x:Name="contentPresenter" 
+                              ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" 
+                              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" 
+                              Content="{TemplateBinding SelectionBoxItem}" 
+                              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" 
+                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
+                              IsHitTestVisible="false" Margin="{TemplateBinding Padding}" 
+                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
+                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+        </Grid>
+        <ControlTemplate.Triggers>
+            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
+                <Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
+                <Setter Property="Color" TargetName="shadow" Value="#71000000"/>
+            </Trigger>
+            <Trigger Property="HasItems" Value="false">
+                <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
+            </Trigger>
+            <MultiTrigger>
+                <MultiTrigger.Conditions>
+                    <Condition Property="IsGrouping" Value="true"/>
+                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
+                </MultiTrigger.Conditions>
+                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
+            </MultiTrigger>
+            <Trigger Property="ScrollViewer.CanContentScroll" 
+                     SourceName="DropDownScrollViewer" 
+                     Value="false">
+                <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
+                <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
+            </Trigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
+
+    <!--主要下拉框样式-->
+    <Style x:Key="ComboBox.Primary" TargetType="{x:Type ComboBox}">
+        <Setter Property="FocusVisualStyle" Value="{StaticResource ComboBox.FocusVisual}"/>
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>
+        <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
+        <Setter Property="BorderThickness" Value="1"/>
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
+        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
+        <Setter Property="Padding" Value="6,3,5,3"/>
+        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
+        <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
+        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="Template" Value="{StaticResource ComboBox.Template}"/>
+    </Style>
+
+</ResourceDictionary>

+ 1 - 0
SKMC.UI/Styles/DataGrid.xaml

@@ -66,6 +66,7 @@
     <!--行样式触发-->
     <Style x:Key="DataGrid.Row"  TargetType="{x:Type DataGridRow}">
         <!--<Setter Property="Height" Value="30"/>-->
+        <Setter Property="Background" Value="Transparent"/>
         <Setter Property="Focusable" Value="True"/>
         <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
         <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>

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

@@ -158,6 +158,9 @@
                             <Setter TargetName="theme" Property="Data" Value="{DynamicResource Icon.Moon}"/>
                             <Setter TargetName="theme" Property="Fill" Value="{DynamicResource Brush.Text}"/>
                         </Trigger>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter Property="Background" Value="{DynamicResource Brush.ButtonHover}"/>
+                        </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>
             </Setter.Value>

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

@@ -1,5 +1,6 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <!--深色主题-->
     <Color x:Key="Color.Background">#1E1E1E</Color>
     <Color x:Key="Color.DarkBackground">#161616</Color>
     <Color x:Key="Color.MachineControls">#121212</Color>

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

@@ -1,6 +1,6 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-    <!-- 浅色主题颜色定义 -->
+    <!-- 浅色主题 -->
     <Color x:Key="Color.Background">#FFFFFF</Color>
     <Color x:Key="Color.DarkBackground">#E8F1FA</Color>
     <Color x:Key="Color.MachineControls">#DCDCDC</Color>