|
<UserControl x:Class="BookReader.Controls.RatingControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel x:Name="RatingContentPanel" Orientation="Horizontal">
<StackPanel.Resources>
<ControlTemplate x:Key="starTemplate" TargetType="{x:Type ToggleButton}">
<Border Background="Transparent">
<Viewbox>
<Path Name="star" Fill="Gray" Data="F1 M 145.637,174.227L 127.619,110.39L 180.809,70.7577L 114.528,68.1664L 93.2725,5.33333L 70.3262,67.569L 4,68.3681L 56.0988,109.423L 36.3629,172.75L 91.508,135.888L 145.637,174.227 Z" Stretch="Uniform"/>
</Viewbox>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="star" Property="Fill" Value="#f0bc00"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</StackPanel.Resources>
<ToggleButton Margin="0" Padding="0" Tag="1" Cursor="Hand" Template="{StaticResource starTemplate}" Click="RatingButtonClickEventHandler" />
<ToggleButton Margin="0" Padding="0" Tag="2" Cursor="Hand" Template="{StaticResource starTemplate}" Click="RatingButtonClickEventHandler" />
<ToggleButton Margin="0" Padding="0" Tag="3" Cursor="Hand" Template="{StaticResource starTemplate}" Click="RatingButtonClickEventHandler" />
<ToggleButton Margin="0" Padding="0" Tag="4" Cursor="Hand" Template="{StaticResource starTemplate}" Click="RatingButtonClickEventHandler" />
<ToggleButton Margin="0" Padding="0" Tag="5" Cursor="Hand" Template="{StaticResource starTemplate}" Click="RatingButtonClickEventHandler" />
</StackPanel>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
WPF and MVVM fan, I practice C # in all its forms from the beginning of the NET Framework without mentioning C ++ / MFC and other software packages such as databases, ASP, WCF, Web & Windows services, Application, and now Core and UWP.
In my wasted hours, I am guilty of having fathered C.B.R. and its cousins C.B.R. for WinRT and UWP on the Windows store.
But apart from that, I am a great handyman ... the house, a rocket stove to heat the jacuzzi and the last one: a wood oven for pizza, bread, and everything that goes inside
https://guillaumewaser.wordpress.com/
https://fouretcompagnie.wordpress.com/