109 lines
7.0 KiB
XML
109 lines
7.0 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="Base/ButtonBaseStyle.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<!--Button-->
|
|
<Style BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource DefaultBrush}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
</Style>
|
|
<Style x:Key="ButtonPrimary" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonSuccess" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonInfo" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonWarning" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonDanger" BasedOn="{StaticResource ButtonBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
|
|
</Style>
|
|
|
|
<!--ButtonIcon-->
|
|
<Style x:Key="ButtonIconTransparent" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
|
<ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
|
<Path Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}" RenderTransformOrigin="0.5,0.5">
|
|
<Path.RenderTransform>
|
|
<TransformGroup>
|
|
<RotateTransform Angle="{Binding Path=(controls:IconElement.Angle),RelativeSource={RelativeSource TemplatedParent}}"/>
|
|
</TransformGroup>
|
|
</Path.RenderTransform>
|
|
</Path>
|
|
</ContentControl>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="ButtonIconDefault" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource DefaultBrush}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
</Style>
|
|
<Style x:Key="ButtonIconPrimary" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonIconSuccess" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource DarkSuccessBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonIconInfo" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonIconWarning" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
|
|
</Style>
|
|
<Style x:Key="ButtonIconDanger" BasedOn="{StaticResource ButtonIconBaseStyle}" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
|
|
</Style>
|
|
|
|
<Style x:Key="ButtonOpacityStyle" TargetType="{x:Type Button}">
|
|
<Setter Property="Background" Value="{x:Null}"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="Focusable" Value="False"/>
|
|
<Setter Property="IsTabStop" Value="False"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Border x:Name="Chrome" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
|
<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Opacity" Value=".9"/>
|
|
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter Property="Opacity" Value=".6"/>
|
|
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(controls:BackgroundSwitchElement.MouseDownBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Opacity" Value=".2"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
</ResourceDictionary> |