MatrixRadioControl.xaml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <UserControl x:Class="ComPDFKit.Controls.Common.MatrixRadioControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ComPDFKit.Controls.Common"
  7. mc:Ignorable="d"
  8. Height="92" Width="92">
  9. <UserControl.Resources>
  10. <ResourceDictionary>
  11. <local:TagToBoolConverter x:Key="TagToBoolConverter"></local:TagToBoolConverter>
  12. <ResourceDictionary.MergedDictionaries>
  13. <ResourceDictionary Source="../../Asset/Styles/RadioButtonStyle.xaml"></ResourceDictionary>
  14. </ResourceDictionary.MergedDictionaries>
  15. </ResourceDictionary>
  16. </UserControl.Resources>
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition />
  20. <RowDefinition />
  21. <RowDefinition />
  22. </Grid.RowDefinitions>
  23. <Grid.ColumnDefinitions>
  24. <ColumnDefinition />
  25. <ColumnDefinition />
  26. <ColumnDefinition />
  27. </Grid.ColumnDefinitions>
  28. <!-- Row 1 -->
  29. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="0" Grid.Column="0" Tag="0" IsChecked="{Binding SelectedTagValue, ConverterParameter=0, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  30. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="0" Grid.Column="1" Tag="1" IsChecked="{Binding SelectedTagValue, ConverterParameter=1, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  31. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="0" Grid.Column="2" Tag="2" IsChecked="{Binding SelectedTagValue, ConverterParameter=2, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  32. <!-- Row 2 -->
  33. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="1" Grid.Column="0" Tag="3" IsChecked="{Binding SelectedTagValue, ConverterParameter=3, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  34. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="1" Grid.Column="1" Tag="4" IsChecked="{Binding SelectedTagValue, ConverterParameter=4, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  35. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="1" Grid.Column="2" Tag="5" IsChecked="{Binding SelectedTagValue, ConverterParameter=5, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  36. <!-- Row 3 -->
  37. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="2" Grid.Column="0" Tag="6" IsChecked="{Binding SelectedTagValue, ConverterParameter=6, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  38. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="2" Grid.Column="1" Tag="7" IsChecked="{Binding SelectedTagValue, ConverterParameter=7, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  39. <RadioButton Style="{StaticResource MatrixRadioButton}" Grid.Row="2" Grid.Column="2" Tag="8" IsChecked="{Binding SelectedTagValue, ConverterParameter=8, RelativeSource={RelativeSource AncestorType={x:Type local:MatrixRadioControl}}, Converter={StaticResource TagToBoolConverter}}" Checked="RadioButton_Checked"/>
  40. </Grid>
  41. </UserControl>