<UserControl x:Class="Compdfkit_Tools.PDFControl.RadioButtonProperty"
             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.PDFControl" xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
             mc:Ignorable="d"
             Loaded="UserControl_Loaded"
             Unloaded="UserControl_Unloaded"
             >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Asset/Styles/TabControlStyle.xaml"></ResourceDictionary>
                <ResourceDictionary Source="../../Asset/Styles/TabItemStyle.xaml"></ResourceDictionary>
                <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border BorderThickness="0" BorderBrush="#1A000000">
            <Grid  Height="40" Background="White" >
                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Radio Button" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
            </Grid>
        </Border>
        <TabControl Grid.Row="1" Style="{DynamicResource TabControlStyle1}" BorderThickness="0">
            <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="General">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="16"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="16"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Grid Grid.ColumnSpan="3">
                        <StackPanel x:Name="WarningPanel" Orientation="Horizontal" Background="#1EFF0000" Height="44">
                            <Path Fill="Black" Margin="8,10,8,0" VerticalAlignment="Top" Data="M1.77832 10.1978H10.2163C11.022 10.1978 11.5269 9.61768 11.5269 8.88721C11.5269 8.66699 11.4731 8.44678 11.355 8.24268L7.12793 0.696289C6.88623 0.26123 6.44043 0.0302734 6 0.0302734C5.5542 0.0302734 5.1084 0.26123 4.8667 0.696289L0.64502 8.24805C0.532227 8.45215 0.467773 8.66699 0.467773 8.88721C0.467773 9.61768 0.972656 10.1978 1.77832 10.1978ZM6 6.60986C5.7207 6.60986 5.57031 6.44873 5.56494 6.16406L5.48975 3.24219C5.48438 2.95752 5.69385 2.75342 5.99463 2.75342C6.29004 2.75342 6.51025 2.96289 6.50488 3.24756L6.42969 6.16406C6.42432 6.4541 6.26855 6.60986 6 6.60986ZM6 8.40918C5.68311 8.40918 5.40381 8.15137 5.40381 7.83447C5.40381 7.51221 5.67773 7.25439 6 7.25439C6.32764 7.25439 6.60156 7.50684 6.60156 7.83447C6.60156 8.15674 6.32227 8.40918 6 8.40918Z"/>
                            <TextBlock Margin="0,8,8,8" VerticalAlignment="Center" Text="One button in group. At lease two buttons needed." Width="224" TextWrapping="Wrap"/>
                        </StackPanel>
                    </Grid>
                    <StackPanel Grid.Column="1" Grid.Row="1">
                        <StackPanel  >
                            <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Text" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
                            <TextBox x:Name="FieldNameText" Margin="0,8,0,0" TextChanged="FieldNameText_TextChanged"/>
                        </StackPanel>
                        <StackPanel >
                            <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Form Field" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
                            <ComboBox x:Name="FormFieldCombox" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FormFieldCombox_SelectionChanged">
                                <ComboBoxItem Content="Visible"/>
                                <ComboBoxItem Content="Hidden"/>
                                <ComboBoxItem Content="Visible but doesn't print"/>
                                <ComboBoxItem Content="Hidden but printable"/>
                            </ComboBox>
                        </StackPanel>
                    </StackPanel>

                    <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Orientation="Horizontal" Background="#E2E3E6" VerticalAlignment="Bottom">
                        <Path Fill="Black" Margin="8,10,8,0" VerticalAlignment="Top" Data="M6 11.6006C3.0083 11.6006 0.521484 9.11377 0.521484 6.12207C0.521484 3.125 3.00293 0.643555 5.99463 0.643555C8.9917 0.643555 11.4785 3.125 11.4785 6.12207C11.4785 9.11377 8.99707 11.6006 6 11.6006ZM5.94629 4.16162C6.34912 4.16162 6.66602 3.83936 6.66602 3.43115C6.66602 3.02295 6.34912 2.70068 5.94629 2.70068C5.54346 2.70068 5.22119 3.02295 5.22119 3.43115C5.22119 3.83936 5.54346 4.16162 5.94629 4.16162ZM5.02783 9.17822H7.27832C7.50928 9.17822 7.68652 9.01172 7.68652 8.78076C7.68652 8.56592 7.50928 8.38867 7.27832 8.38867H6.59619V5.57959C6.59619 5.27881 6.4458 5.07471 6.16113 5.07471H5.11914C4.89355 5.07471 4.71631 5.25195 4.71631 5.4668C4.71631 5.69775 4.89355 5.86426 5.11914 5.86426H5.70996V8.38867H5.02783C4.79688 8.38867 4.61963 8.56592 4.61963 8.78076C4.61963 9.01172 4.79688 9.17822 5.02783 9.17822Z"/>
                        <TextBlock Margin="0,8,8,8" VerticalAlignment="Center" Text="To create a set of mutually exclusive radio buttons (i.e., where only one can be selected at a time), give the fields the same name but different button choices." Width="224" TextWrapping="Wrap"/>
                    </StackPanel>
                </Grid>
            </TabItem>
            <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="Appearance">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="16"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="16"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="1">
                        <StackPanel>
                            <TextBlock  Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Border Color" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
                            <cpdfcommon:ColorPickerControl Margin="0,18,0,0" x:Name="BorderColorPickerControl" ColorChanged="BorderColorPickerControl_ColorChanged"/>
                        </StackPanel>
                        <StackPanel>
                            <TextBlock  Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Background Color" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
                            <cpdfcommon:ColorPickerControl Margin="0,18,0,0" x:Name="BackgroundColorPickerControl" ColorChanged="BackgroundColorPickerControl_ColorChanged"/>
                        </StackPanel>
                    </StackPanel>
                </Grid>
            </TabItem>
            <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="Preferences">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="16"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="16"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="1">
                        <StackPanel  >
                            <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="Button Style" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
                            <ComboBox x:Name="RadioButtonStyleCombox" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="RadioButtonStyleCombox_SelectionChanged">
                                <ComboBoxItem Content="Check"/>
                                <ComboBoxItem Content="Circle"/>
                                <ComboBoxItem Content="Cross"/>
                                <ComboBoxItem Content="Diamond"/>
                                <ComboBoxItem Content="Square"/>
                                <ComboBoxItem Content="Star"/>
                            </ComboBox>
                        </StackPanel>
                        <StackPanel >
                            <CheckBox x:Name="chkSelected" Content="Selected by default" FontSize="14" VerticalContentAlignment="Center" FontFamily="Segoe UI" FontWeight="Bold" Margin="0 14 0 0" Checked="chkSelected_Checked"  Unchecked="chkSelected_Unchecked"/>
                        </StackPanel>
                    </StackPanel>
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</UserControl>
