1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <Button x:Class="CyberX8_Themes.UserControls.PathButton"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:CyberX8_Themes.UserControls"
- mc:Ignorable="d" Style="{DynamicResource PathButtonStyle}"
- d:DesignHeight="450" d:DesignWidth="800">
- <Button.Resources>
- <Style x:Key="FocusVisual">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle Margin="2"
- SnapsToDevicePixels="true"
- Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="PathButtonStyle"
- TargetType="{x:Type Button}">
- <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
- <Setter Property="Background" Value="#00000000" />
- <Setter Property="BorderBrush" Value="#00000000" />
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
- <Setter Property="BorderThickness" Value="0,1,1,1" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="1" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border x:Name="border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- SnapsToDevicePixels="true">
- <Path x:Name="Path"
- Data="{Binding PathData}"
- Fill="{Binding DefaultFillBrush}"
- RenderTransformOrigin="0.5,0.5"
- Stretch="Uniform" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsDefaulted" Value="True">
- <Setter TargetName="Path" Property="Fill" Value="{Binding DefaultFillBrush}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="Path" Property="Fill" Value="{Binding MouseOverBrush}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="Path" Property="Fill" Value="{Binding IsPressedBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Path" Property="Fill" Value="{Binding IsEnabledBrush}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Button.Resources>
- </Button>
|