math-suite/Source/GraphingCalculator/Styles/RadioButtonStyle.xaml

63 lines
3.5 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="RadioButton">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid>
<Border Name="border" BorderBrush="Gray" BorderThickness="1">
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#EEE" Offset="0" />
<GradientStop Color="#BBB" Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
<ContentPresenter Margin="4,1,4,1" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Background" Value="White">
<Setter TargetName="border" Property="CornerRadius" Value="5,0,0,5" />
<Setter TargetName="border" Property="BorderThickness" Value="1,1,0,1" />
</Trigger>
<Trigger Property="Background" Value="Black">
<Setter TargetName="border" Property="CornerRadius" Value="0,5,5,0" />
<Setter TargetName="border" Property="BorderThickness" Value="1,1,1,1" />
</Trigger>
<Trigger Property="Background" Value="Gray">
<Setter TargetName="border" Property="CornerRadius" Value="0" />
<Setter TargetName="border" Property="BorderThickness" Value="1,1,0,1" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#FFF" Offset="0" />
<GradientStop Color="#C8C8C8" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="border" Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#BBB" Offset="0" />
<GradientStop Color="#DDD" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>