<UserControl x:Class="Compdfkit_Tools.Common.CPDFFontUI"
             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" 
             d:DesignHeight="120" d:DesignWidth="228">
    <UserControl.Resources>
        <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Foreground" Value="#252629" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RadioButton}">
                        <Border
                        x:Name="templateRoot"
                        Background="{TemplateBinding Background}"
                        SnapsToDevicePixels="True">
                            <ContentPresenter
                            x:Name="contentPresenter"
                            Grid.Column="1"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Focusable="False"
                            RecognizesAccessKey="True"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#294982E6"></Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Background" Value="#604982E6"></Setter>
                            </Trigger>
                            <Trigger Property="IsChecked" Value="true">
                                <Setter Property="Background" Value="#294982E6"></Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid>
            <ComboBox x:Name="FontFamilyComboBox" SelectionChanged="FontFamilyComboBox_SelectionChanged" Width="228" Height="28" Margin="0,0,0,4"></ComboBox>
            <TextBox x:Name="FontFamilyTextBox" IsHitTestVisible="False" Width="228" Height="28" VerticalContentAlignment="Center" IsReadOnly="True" Background="#FFFFFF" Padding="0,0,15,0" Margin="0,0,0,4">Helvetica</TextBox>
            <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
                <Path.Data>
                    M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
                </Path.Data>
            </Path>
        </Grid>
        <Grid Grid.Row="1" Margin="0,4,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Grid Margin="0,0,8,0">
                <ComboBox x:Name="FontStyleComboBox" SelectionChanged="FontStyleComboBox_SelectionChanged" Width="148" Height="28" BorderBrush="#1E000000" ></ComboBox>
                <TextBox x:Name="FontStyleTextBox" IsHitTestVisible="False" Width="148" Height="28" VerticalContentAlignment="Center" IsReadOnly="True" Background="#FFFFFF" Padding="0,0,15,0" >Common</TextBox>
                <Path Fill="#43474D" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,5,0" IsHitTestVisible="False">
                    <Path.Data>
                        M0.5 0.510248L4.5041 5.5L8.5 0.5L0.5 0.510248Z
                    </Path.Data>
                </Path>
            </Grid>

            <local:DropDownNumberBoxControl x:Name="FontSizeComboBox" Maxium="100" Minimum="1" Grid.Column="1" Width="72" Height="28" Unit="pt" Text="{Binding FontSizeValue,Mode=TwoWay}"></local:DropDownNumberBoxControl>
        </Grid>

        <Border BorderBrush="#E2E3E6" BorderThickness="1"  Width="148"  Grid.Row="2"  HorizontalAlignment="Left" Margin="0,8,0,0">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <RadioButton x:Name="LeftAlignRadioButton" Tag="Left" Style="{StaticResource GreyBgRadioBtnStyle}" IsChecked="True" Checked="AlignRadioButton_Checked">
                    <RadioButton.Content>
                        <Grid Width="48" Height="30">
                            <Canvas Margin="16,10,0,0">
                                <Rectangle
                               Width="13"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" />
                                <Rectangle
                               Canvas.Top="4"
                               Width="16"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" />
                                <Rectangle
                               Canvas.Top="8"
                               Width="12"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" />
                            </Canvas>
                        </Grid>
                    </RadioButton.Content>
                </RadioButton>
                <RadioButton x:Name="CenterAlignRadioButton" Grid.Column="1" Style="{StaticResource GreyBgRadioBtnStyle}" Tag="Center" Checked="AlignRadioButton_Checked">
                    <RadioButton.Content>
                        <Grid Width="48" Height="30">
                            <Canvas Margin="16,10,0,0">
                                <Rectangle
                               Width="16"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" />
                                <Rectangle
                               Canvas.Top="4"
                               Width="10"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" 
                                Margin="3,0,0,0"/>
                                <Rectangle
                               Canvas.Top="8"
                               Width="16"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" />
                            </Canvas>
                        </Grid>
                    </RadioButton.Content>
                </RadioButton>
                <RadioButton x:Name="RightAlignRadioButton" Grid.Column="2" Style="{StaticResource GreyBgRadioBtnStyle}" Tag="Right" Checked="AlignRadioButton_Checked">
                    <RadioButton.Content >
                        <Grid Width="48" Height="30">
                            <Canvas Margin="13,10,0,0">
                                <Rectangle
                               Width="13"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" 
                               Margin="3,0,0,0"/>
                                <Rectangle
                               Canvas.Top="4"
                               Width="16"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5"/>
                                <Rectangle
                               Canvas.Top="8"
                               Width="13"
                               Height="1.5"
                               Stroke="#000000"
                               StrokeThickness="1.5" 
                               Margin="3,0,0,0"/>
                            </Canvas>
                        </Grid>
                    </RadioButton.Content>
                </RadioButton>
            </Grid>
        </Border>
    </Grid>
</UserControl>