65 lines
3.4 KiB
XML
65 lines
3.4 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:controls="clr-namespace:WPFluent.Controls"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<Style TargetType="{x:Type controls:ThumbRate}" x:Key="DefaultUiThumbRateStyle">
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="{DynamicResource SystemFillColorAttentionBrush}" />
|
|
<Setter Property="FontSize" Value="24" />
|
|
<Setter Property="Focusable" Value="False" />
|
|
<Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type controls:ThumbRate}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<controls:Button
|
|
Background="Transparent"
|
|
BorderBrush="Transparent"
|
|
Command="{Binding Path=TemplateButtonCommand, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
|
|
CommandParameter="{x:Static controls:ThumbRateState.Liked}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Grid.Column="0">
|
|
<controls:SymbolIcon
|
|
FontSize="{TemplateBinding FontSize}"
|
|
Symbol="ThumbLike24"
|
|
x:Name="ThumbsUpButtonIcon" />
|
|
</controls:Button>
|
|
|
|
<controls:Button
|
|
Background="Transparent"
|
|
BorderBrush="Transparent"
|
|
Command="{Binding Path=TemplateButtonCommand, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
|
|
CommandParameter="{x:Static controls:ThumbRateState.Disliked}"
|
|
Foreground="{TemplateBinding Foreground}"
|
|
Grid.Column="1">
|
|
<controls:SymbolIcon
|
|
FontSize="{TemplateBinding FontSize}"
|
|
Symbol="ThumbDislike24"
|
|
x:Name="ThumbsDownButtonIcon" />
|
|
</controls:Button>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="State" Value="Liked">
|
|
<Setter Property="Filled" TargetName="ThumbsUpButtonIcon" Value="True" />
|
|
</Trigger>
|
|
<Trigger Property="State" Value="Disliked">
|
|
<Setter Property="Filled" TargetName="ThumbsDownButtonIcon" Value="True" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style BasedOn="{StaticResource DefaultUiThumbRateStyle}" TargetType="{x:Type controls:ThumbRate}" />
|
|
|
|
</ResourceDictionary>
|