浏览代码

增加DataGrid控件样式

Jiangsheng 1 月之前
父节点
当前提交
7bbbd1a35b

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

@@ -6,6 +6,7 @@
     </ResourceDictionary.MergedDictionaries>
     <SolidColorBrush x:Key="Brush.Background" Color="{StaticResource Color.Background}" />
     <SolidColorBrush x:Key="Brush.DarkBackground" Color="{StaticResource Color.DarkBackground}" />
+    <SolidColorBrush x:Key="Brush.PreviewBackground" Color="{StaticResource Color.PreviewBackground}" />
     <SolidColorBrush x:Key="Brush.MachineControls" Color="{StaticResource Color.MachineControls}" />
     <SolidColorBrush x:Key="Brush.Overlay2Percent" Opacity="0.02" Color="{StaticResource Color.Overlay}" />
     <SolidColorBrush x:Key="Brush.Overlay3Percent" Opacity="0.03" Color="{StaticResource Color.Overlay}" />

+ 45 - 0
SKMC.UI/CustomControls/SKButton.cs

@@ -3,12 +3,57 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Media;
 
 namespace SKMC.UI.CustomControls
 {
     public class SKButton : Button
     {
+        static SKButton()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(SKButton), new FrameworkPropertyMetadata(typeof(SKButton)));
+        }
 
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for CornerRadius.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty CornerRadiusProperty =
+            DependencyProperty.Register(nameof(CornerRadius), typeof(CornerRadius), typeof(SKButton), new PropertyMetadata(new CornerRadius(0,0,0,0)));
+
+        public Geometry Icon
+        {
+            get { return (Geometry)GetValue(IconProperty); }
+            set { SetValue(IconProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty IconProperty =
+            DependencyProperty.Register(nameof(Icon), typeof(Geometry), typeof(SKButton), new PropertyMetadata(null));
+
+        public double IconSize
+        {
+            get { return (double)GetValue(IconSizeProperty); }
+            set { SetValue(IconSizeProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for IconSize.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty IconSizeProperty =
+            DependencyProperty.Register(nameof(IconSize), typeof(double), typeof(SKButton), new PropertyMetadata(20.0));
+
+        public SolidColorBrush IconFillColor
+        {
+            get { return (SolidColorBrush)GetValue(IconFillColorProperty); }
+            set { SetValue(IconFillColorProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for IconFillColor.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty IconFillColorProperty =
+            DependencyProperty.Register(nameof(IconFillColor), typeof(SolidColorBrush), typeof(SKButton), new PropertyMetadata(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0))));
     }
 }

+ 1 - 0
SKMC.UI/FrameWork.xaml

@@ -14,6 +14,7 @@
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/TextBox.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/ToggleButton.xaml"/>
         <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/TextBlock.xaml"/>
+        <ResourceDictionary Source="pack://application:,,,/SKMC.UI;component/Styles/DataGrid.xaml"/>
         <!--Styles-->
     </ResourceDictionary.MergedDictionaries>
 </ResourceDictionary>

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

@@ -111,6 +111,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\DataGrid.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\TextBlock.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 65 - 1
SKMC.UI/Styles/Button.xaml

@@ -1,5 +1,6 @@
 <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"
+                    xmlns:c="clr-namespace:SKMC.UI.CustomControls">
     <!--基础按钮-->
     <Style x:Key="Button.Base" TargetType="{x:Type Button}">
         <Setter Property="HorizontalContentAlignment" Value="Center"/>
@@ -69,4 +70,67 @@
             </Setter.Value>
         </Setter>
     </Style>
+    <!--按钮图标带图标-->
+    <Style x:Key="Button.WithIcon" TargetType="{x:Type c:SKButton}">
+        <Setter Property="IconSize" Value="{DynamicResource FontSize.Headline}"/>
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="BorderThickness" Value="1"/>
+        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}"/>
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="Width" Value="120"/>
+        <Setter Property="Height" Value="40"/>
+        <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Headline}"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type c:SKButton }">
+                    <Border x:Name="border"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            CornerRadius="{TemplateBinding CornerRadius}"
+                            Width="{TemplateBinding Width}"
+                            Height="{TemplateBinding Height}"
+                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalAlignment}">
+                        <Grid>
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="Auto"/>
+                                <ColumnDefinition Width="*"/>
+                            </Grid.ColumnDefinitions>
+                            <Path x:Name="icon"
+                                  Data="{TemplateBinding Icon}"
+                                  Width="{TemplateBinding IconSize}"
+                                  Height="{TemplateBinding IconSize}"
+                                  Fill="{TemplateBinding IconFillColor}"
+                                  Stretch="Uniform"
+                                  HorizontalAlignment="Center"
+                                  VerticalAlignment="Center"
+                                  Margin="5 0 0 0"/>
+                            <ContentPresenter Grid.Column="1"
+                                              Content="{TemplateBinding Content}"
+                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter Property="BorderBrush" Value="{Binding IconFillColor, RelativeSource={RelativeSource Self}}"/>
+                            <Setter Property="Foreground" Value="{Binding IconFillColor, RelativeSource={RelativeSource Self}}"/>
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter Property="Background" Value="{DynamicResource Brush.ButtonPressed}"/>
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter Property="Background" Value="{DynamicResource Brush.ButtonTextDisabled}"/>
+                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.ButtonTextInactive}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 </ResourceDictionary>

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

@@ -0,0 +1,140 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <!--标题栏样式-->
+    <Style x:Key="DataGrid.ColumnHeader" TargetType="{x:Type DataGridColumnHeader}">
+        <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="HorizontalAlignment" Value="Center"/>-->
+        <Setter Property="VerticalAlignment" Value="Center" />
+        <Setter Property="BorderBrush" Value="Transparent"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Margin" Value="5"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
+                    <Border x:Name="BackgroundBorder" 
+                            BorderThickness="{TemplateBinding BorderThickness}" 
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            Background="{TemplateBinding Background}">
+                        <ContentPresenter  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
+                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                        Content="{TemplateBinding Content}"/>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <!--行样式触发-->
+    <Style x:Key="DataGrid.Row"  TargetType="{x:Type DataGridRow}">
+        <!--<Setter Property="Height" Value="30"/>-->
+        <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}" />
+        <Style.Triggers>
+            <!--隔行换色-->
+            <Trigger Property="AlternationIndex" Value="0" >
+                <Setter Property="Background" Value="{DynamicResource Brush.PreviewBackground}" />
+            </Trigger>
+            <Trigger Property="AlternationIndex" Value="1" >
+                <Setter Property="Background" Value="#343434" />
+            </Trigger>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Background" Value="{DynamicResource Brush.Neutral}"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+    <!--单元格样式触发-->
+    <Style x:Key="DataGrid.Cell" TargetType="{x:Type DataGridCell}">
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="HorizontalAlignment" Value="Stretch"/>
+        <Setter Property="VerticalAlignment" Value="Stretch"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="BorderBrush" Value="Transparent"/>
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>
+        <Setter Property="Margin" Value="0 5 0 5"/>
+        <Setter Property="Focusable" Value="True"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type DataGridCell}">
+                    <Border Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            HorizontalAlignment="Stretch"
+                            VerticalAlignment="Stretch">
+                        <ContentPresenter HorizontalAlignment="Stretch"
+                                          VerticalAlignment="Stretch"/>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Style.Triggers>
+            <Trigger Property="IsSelected" Value="True">
+                <Setter Property="Foreground" Value="{DynamicResource Brush.SelectionSelected}"/>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+    
+    <ControlTemplate x:Key="Template.DataGrid" TargetType="{x:Type DataGrid}">
+        <Border BorderBrush="{TemplateBinding BorderBrush}"
+                BorderThickness="{TemplateBinding BorderThickness}"
+                Background="{TemplateBinding Background}">
+            <Grid>
+                <Grid.RowDefinitions>
+                    <RowDefinition Height="Auto"/>
+                    <RowDefinition Height="*"/>
+                </Grid.RowDefinitions>
+                <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter"
+                                                Grid.Row="0"
+                                                Visibility="Visible"/>
+                <ScrollViewer Grid.Row="1" 
+                              x:Name="PART_ScrollViewer"
+                              Style="{DynamicResource ScrollViewer.Default}">
+                    <ItemsPresenter/>
+                </ScrollViewer>
+            </Grid>
+        </Border>
+    </ControlTemplate>
+    <!--主要DataGrid-->
+    <Style x:Key="DataGrid.Primary" TargetType="{x:Type DataGrid}">
+        <!--网格线颜色-->
+        <Setter Property="Background" Value="{DynamicResource Brush.TextContrast}" />
+        <Setter Property="Foreground" Value="{DynamicResource Brush.TextInactive}"/>
+        <Setter Property="HorizontalGridLinesBrush" Value="Transparent"/>
+        <Setter Property="VerticalGridLinesBrush" Value="Transparent"/>
+        <Setter Property="SnapsToDevicePixels" Value="True"/>
+        <Setter Property="RowHeaderWidth" Value="0"/>
+        <Setter Property="AlternatingRowBackground" Value="#343434"/>
+        <Setter Property="CanUserAddRows" Value="False"/>
+        <Setter Property="CanUserDeleteRows" Value="False"/>
+        <Setter Property="CanUserResizeColumns" Value="True"/>
+        <Setter Property="CanUserResizeRows" Value="False"/>
+        <Setter Property="CanUserSortColumns" Value="False"/>
+        <Setter Property="AutoGenerateColumns" Value="False"/>
+        <Setter Property="ColumnHeaderStyle" Value="{DynamicResource DataGrid.ColumnHeader}"/>
+        <Setter Property="RowStyle" Value="{DynamicResource DataGrid.Row}"/>
+        <Setter Property="CellStyle" Value="{DynamicResource DataGrid.Cell}"/>
+        <Setter Property="Template" Value="{DynamicResource Template.DataGrid}"/>
+        <Setter Property="SelectionUnit" Value="FullRow"/>
+    </Style>
+    <!--DataGrid编辑文本框-->
+    <Style x:Key="DataGrid.EditingTextBox" TargetType="{x:Type TextBox}">
+        <Setter Property="HorizontalAlignment" Value="Stretch"/>
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalAlignment" Value="Stretch"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Background" Value="{DynamicResource Brush.Background}"/>
+        <!--<Setter Property="Width" Value="auto"/>-->
+        <Setter Property="Height" Value="30"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+    </Style>
+</ResourceDictionary>

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

@@ -14,6 +14,7 @@
         <Setter Property="IconFillColor" Value="Transparent"/>
         <Setter Property="IconStrokeColor" Value="{DynamicResource Brush.Icon}"/>
         <Setter Property="IconStrokeThickness" Value="1"/>
+        <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type c:SKRadioButton}">
@@ -114,7 +115,7 @@
         <Setter Property="VerticalContentAlignment" Value="Center"/>
         <Setter Property="Cursor" Value="Hand"/>
         <Setter Property="FontWeight" Value="Normal"/>
-        <Setter Property="FontSize" Value="{DynamicResource FontSize.Headline}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Callout}"/>
         <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
         <Setter Property="Height" Value="40"/>
         <Setter Property="Template">
@@ -134,8 +135,7 @@
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="True">
-                            <Setter TargetName="txtName" Property="Foreground" Value="{DynamicResource Brush.ChartLine.5}"/>
-                            <Setter TargetName="menuButton" Property="Background" Value="{DynamicResource Brush.SelectionSelected}"/>
+                            <Setter TargetName="txtName" Property="Foreground" Value="{DynamicResource Brush.SelectionSelected}"/>
                         </Trigger>
                         <Trigger Property="IsChecked" Value="True">
                             <Setter TargetName="txtName" Property="Foreground" Value="{DynamicResource Brush.SelectionSelected}"/>

+ 7 - 1
SKMC.UI/Styles/TextBox.xaml

@@ -8,7 +8,11 @@
     <Style x:Key="TextBox.Primary" TargetType="{x:Type c:SKTextBox}">
         <Style.Setters>
             <Setter Property="VerticalContentAlignment" Value="Center"/>
+            <Setter Property="VerticalAlignment" Value="Stretch"/>
+            <Setter Property="HorizontalAlignment" Value="Stretch"/>
             <Setter Property="FontSize" Value="12"/>
+            <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+            <Setter Property="IconSize" Value="10"/>
             <Setter Property="Template">
                 <Setter.Value>
                     <ControlTemplate TargetType="{x:Type c:SKTextBox}">
@@ -111,7 +115,9 @@
 								    Grid.Column="2"
 								    Foreground="{DynamicResource Brush.Label}"
 								    Content="{Binding Unit, RelativeSource={RelativeSource TemplatedParent}}"
-                                    FontSize="{TemplateBinding UnitSize}">
+                                    FontSize="{TemplateBinding UnitSize}"
+                                    VerticalAlignment="Bottom"
+                                    HorizontalAlignment="Right">
                                     <FrameworkElement.Style>
                                         <Style TargetType="{x:Type Label}">
                                             <Setter Property="VerticalAlignment" Value="Bottom"/>

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

@@ -43,4 +43,92 @@
             </Setter.Value>
         </Setter>
     </Style>
+    <!--简单照明灯开关-->
+    <Style x:Key="ToggleButton.SimpleLamp" TargetType="{x:Type ToggleButton}">
+        <Setter Property="FontFamily" Value="{DynamicResource FontFamily.Global}"/>
+        <Setter Property="FontSize" Value="{DynamicResource FontSize.Body}"/>
+        <Setter Property="Foreground" Value="{DynamicResource Brush.Text}"/>
+        <Setter Property="BorderThickness" Value="1"/>
+        <Setter Property="BorderBrush" Value="{DynamicResource Brush.Border}"/>
+        <Setter Property="Background" Value="Transparent"/>
+        <Setter Property="HorizontalContentAlignment" Value="Center"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                        <Grid>
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="0.3*"/>
+                                <ColumnDefinition Width="*"/>
+                            </Grid.ColumnDefinitions>
+                            <Path x:Name="light"
+                                  Width="{TemplateBinding FontSize}"
+                                  Height="{TemplateBinding FontSize}"
+                                  VerticalAlignment="Center"
+                                  HorizontalAlignment="Center"
+                                  Stretch="Uniform"/>
+                            <ContentPresenter Grid.Column="1" Content="{TemplateBinding Content}"
+                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="light" Property="Data" Value="{DynamicResource Icon.CameraLightOn}"/>
+                            <Setter TargetName="light" Property="Fill" Value="{DynamicResource Brush.RgbGreen}"/>
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="False">
+                            <Setter TargetName="light" Property="Data" Value="{DynamicResource Icon.CameraLightOff}"/>
+                            <Setter TargetName="light" Property="Fill" Value="{DynamicResource Brush.RgbRed}"/>
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter Property="Foreground" Value="{DynamicResource Brush.SelectionSelected}"/>
+                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.ButtonHover}"/>
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter Property="Background" Value="{DynamicResource Brush.ButtonPressed}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <!--简单安全门锁-->
+    <Style x:Key="ToggleButton.SimpleLocker" TargetType="{x:Type ToggleButton}">
+        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="Background" Value="Transparent"/>
+        <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="locker"
+                              Margin="5"/>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsChecked" Value="False">
+                            <Setter TargetName="locker" Property="Data" Value="{DynamicResource Icon.LockDoor}"/>
+                            <Setter TargetName="locker" Property="Fill" Value="{DynamicResource Brush.RgbGreen}"/>
+                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.RgbGreen}"/>
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="locker" Property="Data" Value="{DynamicResource Icon.UnlockDoor}"/>
+                            <Setter TargetName="locker" Property="Fill" Value="{DynamicResource Brush.RgbRed}"/>
+                            <Setter Property="BorderBrush" Value="{DynamicResource Brush.RgbRed}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 </ResourceDictionary>