|
25 | 25 | <RowDefinition Height="Auto" />
|
26 | 26 | <RowDefinition Height="Auto" />
|
27 | 27 | <RowDefinition Height="Auto" />
|
28 |
| - <RowDefinition /> |
29 |
| - <RowDefinition /> |
30 |
| - <RowDefinition /> |
31 |
| - <RowDefinition /> |
32 |
| - <RowDefinition /> |
33 |
| - <RowDefinition /> |
34 |
| - <RowDefinition /> |
35 |
| - <RowDefinition /> |
| 28 | + <RowDefinition Height="Auto" /> |
| 29 | + <RowDefinition Height="Auto" /> |
| 30 | + <RowDefinition Height="Auto" /> |
| 31 | + <RowDefinition Height="Auto" /> |
| 32 | + <RowDefinition Height="Auto" /> |
| 33 | + <RowDefinition Height="Auto" /> |
| 34 | + <RowDefinition Height="Auto" /> |
| 35 | + <RowDefinition Height="Auto" /> |
36 | 36 | </Grid.RowDefinitions>
|
37 | 37 | <TextBlock>Buttons</TextBlock>
|
38 | 38 | <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0 24 0 0">
|
|
154 | 154 | </StackPanel>
|
155 | 155 | <TextBlock Margin="0 24 0 0" Grid.Row="9">Rating bar</TextBlock>
|
156 | 156 | <StackPanel Grid.Row="10" Margin="0 16 0 0" Orientation="Horizontal">
|
157 |
| - <wpf:RatingBar x:Name="ratingBar" MaxRating="5" Rating="2"> |
158 |
| - <wpf:RatingBar.RatingItemTemplate> |
159 |
| - <DataTemplate> |
160 |
| - <Viewbox Width="21" Height="21"> |
161 |
| - <Canvas Width="24" Height="24"> |
162 |
| - <Path Data="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z" |
163 |
| - Fill="{StaticResource PrimaryHueMidBrush}" /> |
164 |
| - </Canvas> |
165 |
| - </Viewbox> |
| 157 | + <wpf:RatingBar Value="3" x:Name="BasicRatingBar" /> |
| 158 | + <TextBlock Text="{Binding ElementName=BasicRatingBar, Path=Value, StringFormat=Rating: {0}}" VerticalAlignment="Top" Margin="10,2,0,0" /> |
| 159 | + <wpf:RatingBar x:Name="CustomRatingBar" Max="3" Value="2" Margin="24 0 0 0" Orientation="Vertical"> |
| 160 | + <wpf:RatingBar.ValueItemTemplate> |
| 161 | + <DataTemplate DataType="system:Int32"> |
| 162 | + <Grid> |
| 163 | + <Viewbox Width="24" Height="24"> |
| 164 | + <Canvas Width="24" Height="24"> |
| 165 | + <Path Data="M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z" |
| 166 | + Fill="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Control}, Path=Foreground}" /> |
| 167 | + </Canvas> |
| 168 | + </Viewbox> |
| 169 | + <TextBlock Text="{Binding}" HorizontalAlignment="Center" VerticalAlignment="Center" |
| 170 | + FontSize="8" |
| 171 | + Foreground="{DynamicResource PrimaryHueMidForegroundBrush}"/> |
| 172 | + </Grid> |
166 | 173 | </DataTemplate>
|
167 |
| - </wpf:RatingBar.RatingItemTemplate> |
| 174 | + </wpf:RatingBar.ValueItemTemplate> |
168 | 175 | </wpf:RatingBar>
|
169 |
| - <TextBlock Text="Rating: " VerticalAlignment="Center" Margin="10,0,0,0" /> |
170 |
| - <TextBlock x:Name="ratingTextBlock" Text="{Binding Path=Rating, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" /> |
171 |
| - <wpf:RatingBar MaxRating="7" Rating="5" IsEnabled="False" Margin="20,0,0,0" Width="224" /> |
172 |
| - <TextBlock Text="disabled" VerticalAlignment="Center" Margin="10,0,0,0" /> |
| 176 | + <TextBlock Text="{Binding ElementName=CustomRatingBar, Path=Value, StringFormat=Rating: {0}}" VerticalAlignment="Top" Margin="10,2,0,0" /> |
173 | 177 | </StackPanel>
|
174 | 178 | </Grid>
|
175 | 179 | </UserControl>
|
0 commit comments