123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style x:Key="SwitchCheckBox" TargetType="CheckBox">
- <Setter Property="IsChecked" Value="False"/>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground" Value="{StaticResource BackgroundColor}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="CheckBox">
- <Border x:Name="Status" Width="40" Height="20" CornerRadius="10">
- <Grid>
- <Border x:Name="border" Width="18" Height="18" Margin="1" CornerRadius="10" VerticalAlignment="Center" HorizontalAlignment="Left" Background="White" BorderBrush="{StaticResource ThemeColor}" BorderThickness="0">
- <Border.RenderTransform>
- <TranslateTransform X="0"/>
- </Border.RenderTransform>
- </Border>
- <TextBlock x:Name="txt" Text="{TemplateBinding Content}" Margin="4,0" VerticalAlignment="Center" Foreground="White" FontSize="8">
- <TextBlock.RenderTransform>
- <TranslateTransform X="17"></TranslateTransform>
- </TextBlock.RenderTransform>
- </TextBlock>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter Property="Text" TargetName="txt" Value="ON"/>
- <Setter Property="Background" TargetName="Status" Value="#33c1a9"/>
- <Trigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="20" Duration="00:00:0.2"/>
- <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
- </Storyboard>
- </BeginStoryboard>
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
- <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="18" Duration="00:00:0.2"/>
- </Storyboard>
- </BeginStoryboard>
- </Trigger.ExitActions>
- </Trigger>
- <Trigger Property="IsChecked" Value="False">
- <Setter Property="Background" TargetName="Status" Value="DarkGray"/>
- <Setter Property="Text" TargetName="txt" Value="OFF"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="chkBullet" TargetType="CheckBox">
- <Setter Property="IsChecked" Value="False"/>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground" Value="{StaticResource TextColor}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="CheckBox">
- <Border x:Name="Status" Width="40" Height="20" CornerRadius="10">
- <Grid>
- <Border x:Name="border" Width="18" Height="18" Margin="1" CornerRadius="10" VerticalAlignment="Center" HorizontalAlignment="Left" Background="White" BorderBrush="{StaticResource ThemeColor}" BorderThickness="0">
- <Border.RenderTransform>
- <TranslateTransform X="0"/>
- </Border.RenderTransform>
- </Border>
- <TextBlock x:Name="txt" Text="{TemplateBinding Content}" Margin="4,0" VerticalAlignment="Center" Foreground="White" FontSize="8">
- <TextBlock.RenderTransform>
- <TranslateTransform X="17"></TranslateTransform>
- </TextBlock.RenderTransform>
- </TextBlock>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter Property="Text" TargetName="txt" Value=""/>
- <Setter Property="Background" TargetName="Status" Value="{StaticResource NormalColor}"/>
- <Trigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="20" Duration="00:00:0.2"/>
- <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
- </Storyboard>
- </BeginStoryboard>
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="0" Duration="00:00:0.2"/>
- <DoubleAnimation Storyboard.TargetName="txt" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" To="18" Duration="00:00:0.2"/>
- </Storyboard>
- </BeginStoryboard>
- </Trigger.ExitActions>
- </Trigger>
- <Trigger Property="IsChecked" Value="False">
- <Setter Property="Background" TargetName="Status" Value="DarkGray"/>
- <Setter Property="Text" TargetName="txt" Value=""/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="RectangleCheckBox" TargetType="CheckBox">
- <Setter Property="Margin" Value="1"/>
- <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="CheckBox">
- <Grid Margin="{TemplateBinding Margin}">
- <ContentPresenter Panel.ZIndex="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
- <Border x:Name="_borderOver" Background="Transparent" BorderBrush="Gray" BorderThickness="0.5" Margin="0" Width="16" Height="16" CornerRadius="4">
- <Path Data="M2,5 5,8 10,1" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="White" StrokeThickness="2"/>
- <!--<Border x:Name="_borderChecked" Visibility="Collapsed" Background="{StaticResource ThemeColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="16" Height="16" CornerRadius="4">-->
- <!--</Border>-->
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="HasContent" Value="True">
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Background" TargetName="_borderOver" Value="{StaticResource ThemeColor}"/>
- <!--<Setter Property="BorderBrush" TargetName="_borderOver" Value="Transparent"/>-->
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ThemeCheckBox" TargetType="CheckBox">
- <Setter Property="Margin" Value="1"/>
- <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="CheckBox">
- <Border Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" CornerRadius="4">
- <Grid >
- <ContentPresenter Panel.ZIndex="0" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.Foreground="{StaticResource TextColor}" Margin="8,12"/>
- <Border x:Name="_borderOver" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" Margin="1">
- </Border>
- <Border x:Name="_borderChecked" Visibility="Collapsed" Background="{StaticResource SubThemeColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="12" Height="12">
- <Path Data="M2,7 5,10 11,2" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="White" StrokeThickness="2"/>
- </Border>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="HasContent" Value="True">
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderBrush" TargetName="_borderOver" Value="White"/>
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Visibility" TargetName="_borderChecked" Value="Visible"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="FunctionCheckBox" TargetType="CheckBox">
- <Setter Property="Margin" Value="1"/>
- <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="CheckBox">
- <Border Background="{TemplateBinding Background}" Margin="{TemplateBinding Margin}" CornerRadius="4">
- <Grid >
- <ContentPresenter Panel.ZIndex="0" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.Foreground="{StaticResource TextColor}" Margin="8,12"/>
- <Border x:Name="_borderOver" Background="Transparent" BorderBrush="Transparent" BorderThickness="1" Margin="1">
- </Border>
- <Border x:Name="_borderChecked" Visibility="Collapsed" Background="{StaticResource SubThemeColor}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="12" Height="12">
- <Path Data="M2,7 5,10 11,2" Margin="0 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="White" StrokeThickness="2"/>
- </Border>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="HasContent" Value="True">
- <Setter Property="FocusVisualStyle">
- <Setter.Value>
- <Style>
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderBrush" TargetName="_borderOver" Value="White"/>
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Visibility" TargetName="_borderChecked" Value="Visible"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|