| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:WPF.UI="clr-namespace:CustomUI">
- <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDBB377" />
- <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070" />
- <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD" />
- <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1" />
- <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6" />
- <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B" />
- <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4" />
- <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5" />
- <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383" />
- <SolidColorBrush x:Key="Button.Checked.Foreground" Color="#FF76E8A6" />
- <Style TargetType="{x:Type WPF.UI:FlatToggleButton}">
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="Background" Value="{StaticResource Button.Pressed.Background}" />
- <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Width" Value="43" />
- <Setter Property="Height" Value="20" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type WPF.UI:FlatToggleButton}">
- <Grid>
- <Border x:Name="border"
- Background="{StaticResource Button.Pressed.Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="10" SnapsToDevicePixels="true" UseLayoutRounding="True" />
- <Border x:Name="InnerBd" Width="15" Height="15" Margin="3,0"
- HorizontalAlignment="Left" VerticalAlignment="Center" Background="White" CornerRadius="100"
- RenderTransformOrigin="0.5,0.5">
- <Border.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </Border.RenderTransform>
- </Border>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="CheckStates">
- <VisualState x:Name="Checked">
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InnerBd" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
- <EasingDoubleKeyFrame KeyTime="0" Value="0">
- <EasingDoubleKeyFrame.EasingFunction>
- <CubicEase EasingMode="EaseOut" />
- </EasingDoubleKeyFrame.EasingFunction>
- </EasingDoubleKeyFrame>
- <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="22">
- <EasingDoubleKeyFrame.EasingFunction>
- <CubicEase EasingMode="EaseOut" />
- </EasingDoubleKeyFrame.EasingFunction>
- </EasingDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
-
- <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)">
- <EasingColorKeyFrame KeyTime="0:0:0" Value="#FFC4E5F6">
- <EasingColorKeyFrame.EasingFunction>
- <CircleEase EasingMode="EaseOut" />
- </EasingColorKeyFrame.EasingFunction>
- </EasingColorKeyFrame>
- <EasingColorKeyFrame KeyTime="0:0:0.2" Value="#FF3399FF">
- <EasingColorKeyFrame.EasingFunction>
- <CircleEase EasingMode="EaseOut" />
- </EasingColorKeyFrame.EasingFunction>
- </EasingColorKeyFrame>
- </ColorAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Unchecked">
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InnerBd" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
- <EasingDoubleKeyFrame KeyTime="0" Value="22">
- <EasingDoubleKeyFrame.EasingFunction>
- <CubicEase EasingMode="EaseIn" />
- </EasingDoubleKeyFrame.EasingFunction>
- </EasingDoubleKeyFrame>
- <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0">
- <EasingDoubleKeyFrame.EasingFunction>
- <CubicEase EasingMode="EaseIn" />
- </EasingDoubleKeyFrame.EasingFunction>
- </EasingDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
- <ColorAnimation BeginTime="00:00:00" Duration="0:0:0.2" From="#FF3399FF"
- Storyboard.TargetName="border"
- Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
- To="#FFC4E5F6" />
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|