<UserControl x:Class="ComPDFKit.Controls.PDFControlUI.CPDFViewModeUI"
             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:common="clr-namespace:ComPDFKit.Controls.Common"
             mc:Ignorable="d" 
             d:DesignHeight="350" d:DesignWidth="350">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
                <ResourceDictionary Source="../../../Asset/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
            <common:CommonResourceConverter x:Key="CommonResourceConverter"/>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Visibility="Collapsed">
            <RadioButton x:Name="ContinuousRadioButton" Tag="Continuous" GroupName="Continuous" IsChecked="True" Click="ContinuousRadioButton_Click">
                <TextBlock Text="Continous"></TextBlock>
                <RadioButton.ToolTip>
                    <ToolTip Content="Continuous"></ToolTip>
                </RadioButton.ToolTip>
            </RadioButton>
            <RadioButton x:Name="DiscontinuousRadioButton" Tag="Discontinuous" GroupName="Continuous" Click="ContinuousRadioButton_Click">
                <TextBlock Text="Discontinous"></TextBlock>
                <RadioButton.ToolTip>
                    <ToolTip Content="Discontinuous"></ToolTip>
                </RadioButton.ToolTip>
            </RadioButton>
            <Rectangle Margin="10,0,10,0" Width="1" Fill="Black"></Rectangle>
            <RadioButton x:Name="SinglePageModeRadioButton" GroupName="ViewMode" Tag="Single" IsChecked="True" Checked="ViewModeRadioButton_Checked">
                <RadioButton.ToolTip>
                    <ToolTip Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_SinglePage}"></ToolTip>
                </RadioButton.ToolTip>
            </RadioButton>
            <RadioButton x:Name="DoublePageModeRadioButton" GroupName="ViewMode" Tag="Double" Grid.Row="1" Checked="ViewModeRadioButton_Checked">
                <RadioButton.ToolTip>
                    <ToolTip Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_DoublePage}"></ToolTip>
                </RadioButton.ToolTip>
            </RadioButton>
            <RadioButton x:Name="BookModeRadioButton" GroupName="ViewMode" Grid.Row="2" Tag="Book" Checked="ViewModeRadioButton_Checked">
                <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_CoverMode}"></TextBlock>
                <RadioButton.ToolTip>
                    <ToolTip Content="Cover Mode"></ToolTip>
                </RadioButton.ToolTip>
            </RadioButton>
        </StackPanel>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>

            <Border BorderThickness="0,0,0,1" BorderBrush="#EDEDED" Padding="0,0,0,7.5" Name="SplitContainer">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"></RowDefinition>
                        <RowDefinition Height="auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <TextBlock Foreground="#43474D" FontSize="14" LineHeight="16" Margin="0,0,0,18"
                               Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Title_SplitView}"></TextBlock>

                    <StackPanel Orientation="Horizontal" Grid.Row="1">
                        <ToggleButton Name="VerticalBtn" Width="50" Height="36" BorderThickness="0" Style="{StaticResource RoundToggleButtonStyle}" 
                                      Background="Transparent" Click="VerticalBtn_Click">
                            <ToggleButton.Content>
                                <Path Name="VerticalPath" Fill="#999999" >
                                    <Path.Data>
                                        M20.5 0H0.5V14H20.5V0ZM4.34628 8.75L4.6731 7.73649H6.05023L6.37455 8.75H6.96333L5.66353 5H5.05979L3.76 8.75H4.34628ZM5.90054 7.26871H4.82279L5.33921 
                                        5.65748H5.38162L5.90054 7.26871ZM10 13V1H11V13H10ZM16.0694 7.69231C16.0694 8.34979 15.6078 8.75 14.8394 8.75H13.36V5H14.807C15.4831 5 15.8897 
                                        5.35863 15.8897 5.93295V5.93815C15.8897 6.32796 15.6128 6.67879 15.2585 6.74116V6.78534C15.745 6.83992 16.0694 7.19854 16.0694 7.68711V7.69231ZM13.9188 
                                        6.59563H14.5825C15.0764 6.59563 15.3334 6.40333 15.3334 6.0395V6.0343C15.3334 5.68087 15.0914 5.47557 14.6773 5.47557H13.9188V6.59563ZM14.7272 
                                        8.27443H13.9188V7.04002H14.6947C15.2211 7.04002 15.498 7.24792 15.498 7.65073V7.65593C15.498 8.05873 15.2311 8.27443 14.7272 8.27443Z
                                    </Path.Data>
                                </Path>
                            </ToggleButton.Content>
                            <ToggleButton.ToolTip>
                                <ToolTip Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_Vertical}"></ToolTip>
                            </ToggleButton.ToolTip>
                        </ToggleButton>

                        <ToggleButton Name="HorizonBtn" Width="50" Height="36" BorderThickness="0" Margin="5,0,0,0" Style="{StaticResource RoundToggleButtonStyle}" 
                                      Background="Transparent" Click="HorizonBtn_Click">
                            <ToggleButton.Content>
                                <Path Name="HorizonPath" Fill="#999999">
                                    <Path.Data>
                                        M0.5 0V16H17.5V0H0.5ZM1 8.5H17V7.5H1V8.5ZM8.45114 5.23649L8.11071 6.25H7.5L8.85395 2.5H9.48285L10.8368 6.25H10.2235L9.88565 
                                        5.23649H8.45114ZM8.60707 4.76871H9.72973L9.18919 3.15748H9.14501L8.60707 4.76871ZM10.8222 12.3923C10.8222 13.0498 10.3415 13.45 
                                        9.54106 13.45H8V9.70001H9.50728C10.2115 9.70001 10.6351 10.0586 10.6351 10.633V10.6382C10.6351 11.028 10.3467 11.3788 9.97765 
                                        11.4412V11.4854C10.4844 11.5399 10.8222 11.8986 10.8222 12.3871V12.3923ZM8.58212 11.2956H9.27339C9.78794 11.2956 10.0556 11.1033 
                                        10.0556 10.7395V10.7343C10.0556 10.3809 9.80353 10.1756 9.37214 10.1756H8.58212V11.2956ZM9.42412 12.9744H8.58212V11.74H9.39033C9.93867 
                                        11.74 10.2271 11.9479 10.2271 12.3507V12.3559C10.2271 12.7587 9.94906 12.9744 9.42412 12.9744Z
                                    </Path.Data>
                                </Path>
                            </ToggleButton.Content>
                            <ToggleButton.ToolTip>
                                <ToolTip Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_Horizontal}"></ToolTip>
                            </ToggleButton.ToolTip>
                        </ToggleButton>

                    </StackPanel>
                </Grid>
            </Border>

            <Border Name="DisplayContainer" Grid.Row="1" Margin="0,30,0,0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"></RowDefinition>
                        <RowDefinition Height="auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <TextBlock Foreground="#43474D" FontSize="14" LineHeight="16" Margin="0,0,0,18"
                               Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Title_DisplayMode}"></TextBlock>

                    <StackPanel Orientation="Horizontal" Grid.Row="1">

                        <ToggleButton Name="SingleViewBtn" Width="50" Height="36" BorderThickness="0" Style="{StaticResource RoundToggleButtonStyle}" Background="Transparent"
                                      Click="SingleViewBtn_Click">
                            <ToggleButton.Content>
                                <Path Name="SingleViewPath" Fill="#999999">
                                    <Path.Data>
                                        M0 0H8L12 4.2V16H0V0Z
                                    </Path.Data>
                                </Path>
                            </ToggleButton.Content>
                            <ToggleButton.ToolTip>
                                <ToolTip Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_SinglePage}"></ToolTip>
                            </ToggleButton.ToolTip>
                        </ToggleButton>

                        <ToggleButton Name="DoubleViewBtn" Width="50" Height="36" BorderThickness="0" Margin="5,0,0,0" Style="{StaticResource RoundToggleButtonStyle}" Background="Transparent"
                                      Click="DoubleViewBtn_Click">
                            <ToggleButton.Content>
                                <Path Name="DoubleViewPath" Fill="#999999">
                                    <Path.Data>
                                        M11 5H1V19H11V5ZM19 5H13V19H23V9.2L19 5Z
                                    </Path.Data>
                                </Path>
                            </ToggleButton.Content>
                            <ToggleButton.ToolTip>
                                <ToolTip Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_DoublePage}"></ToolTip>
                            </ToggleButton.ToolTip>
                        </ToggleButton>
 
                        <ToggleButton Name="BookViewBtn" Width="50" Height="36" BorderThickness="0" Margin="5,0,0,0" Style="{StaticResource RoundToggleButtonStyle}" Background="Transparent"
                                      Click="BookViewBtn_Click">
                            <ToggleButton.Content>
                                <Path Name="BookViewPath" Fill="#999999">
                                    <Path.Data>
                                        <GeometryGroup>
                                            <PathGeometry>M11 15H1V21H11V15ZM23 15H13V21H23V15Z</PathGeometry>
                                            <PathGeometry>M1 3H8L11 6.2V13H1V3Z</PathGeometry>
                                        </GeometryGroup>
                                    </Path.Data>
                                </Path>
                            </ToggleButton.Content>
                            <ToggleButton.ToolTip>
                                <ToolTip Content="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Tooltip_CoverMode}"></ToolTip>
                            </ToggleButton.ToolTip>
                        </ToggleButton>

                    </StackPanel>
                </Grid>
            </Border>

            <Border Grid.Row="2" Margin="0,30,0,0" BorderThickness="0,1,0,1" BorderBrush="#EDEDED" Padding="0,26,0,26">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"></RowDefinition>
                        <RowDefinition Height="auto"></RowDefinition>
                    </Grid.RowDefinitions>

                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock FontSize="14" Foreground="#43474D"
                                   Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Toggle_Continuous}"></TextBlock>
                        <ToggleButton Name="ContinuePageBtn" Style="{StaticResource ToggleButtonSwitchStyle}" Margin="0,0,33,0" Grid.Column="1" Width="40" BorderThickness="0"
                                  Click="ContinuePageBtn_Click"></ToggleButton>
                    </Grid>
                    <Grid Grid.Row="1" x:Name="CropContainer" Visibility="Visible">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Width="auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock FontSize="14" Foreground="#43474D" Margin="0,24,0,0"
                                   Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Toggle_Crop}"></TextBlock>
                        <ToggleButton Name="CropModeBtn" Style="{StaticResource ToggleButtonSwitchStyle}"  Margin="0,24,33,0" Grid.Column="1" Width="40" BorderThickness="0"
                                  Click="CropModeBtn_Click"></ToggleButton>
                    </Grid> 
                </Grid>
            </Border>
        </Grid>
    </Grid>
</UserControl>
