<UserControl x:Class="Compdfkit_Tools.Common.MatrixRadioControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Compdfkit_Tools.Common"
             mc:Ignorable="d" 
             Height="92" Width="92">
    <UserControl.Resources>
        <ResourceDictionary>
            <local:TagToBoolConverter x:Key="TagToBoolConverter"></local:TagToBoolConverter>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Asset/Styles/RadioButtonStyle.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <!-- Row 1 -->
        <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"/>
        <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"/>
        <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"/>

        <!-- Row 2 -->
        <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"/>
        <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"/>
        <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"/>

        <!-- Row 3 -->
        <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"/>
        <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"/>
        <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"/>
    </Grid>
</UserControl>