<UserControl x:Class="PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePageSplitDialog"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:cus="clr-namespace:PDF_Master.CustomControl"
             xmlns:prism="http://prismlibrary.com/"             
             prism:ViewModelLocator.AutoWireViewModel="True"
             Height="521"
             Width="583"
              d:DesignHeight="521"
             d:DesignWidth="583"
             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
             mc:Ignorable="d">
    <cus:DialogContent Header="拆分">
        <cus:DialogContent.Content>
            <Grid Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="409"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="212"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0" VerticalAlignment="Top">
                        <cus:PageTurningPreview x:Name="SplitPreview" Loaded="PageTurningPreview_Loaded" ></cus:PageTurningPreview>
                    </Grid>
                    <Grid Grid.Column="1" Margin="7,20,10,40">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="4*"></RowDefinition>
                            <RowDefinition Height="4*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid Grid.Row="0">
                            <StackPanel Orientation="Vertical" >
                                <TextBlock Text="拆分方式" Height="22" Width="56" HorizontalAlignment="Left" Margin="0,0,0,17"></TextBlock>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
                                    <RadioButton VerticalAlignment="Center" IsChecked="{Binding AveragePagesIsCheck}" Command="{Binding AveragePagesCommand}"></RadioButton>
                                    <TextBlock Text="平均每"  VerticalAlignment="Center"></TextBlock>
                                    <cus:NumericUpDown Height="32" Width="110" Minimum="1" Text="{Binding AveragePagesText,Mode=TwoWay}" IsEnabled="{Binding AveragePagesIsEnabled}"></cus:NumericUpDown>
                                    <TextBlock Text="页拆分为一个文件"  VerticalAlignment="Center"></TextBlock>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
                                    <RadioButton VerticalAlignment="Center" IsChecked="{Binding AverageFilesIsCheck}"  Command="{Binding AverageFilesCommand}"></RadioButton>
                                    <TextBlock Text="平均拆分为"  VerticalAlignment="Center"></TextBlock>
                                    <cus:NumericUpDown Height="32" Width="110" Minimum="1"  Text="{Binding AverageFilesText,Mode=TwoWay}" IsEnabled="{Binding AverageFilesIsEnabled}"></cus:NumericUpDown>
                                    <TextBlock Text="个PDF文件"  VerticalAlignment="Center"></TextBlock>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <RadioButton VerticalAlignment="Center" IsChecked="{Binding CustomPageRangeIsCheck}" Command="{Binding CustomPageRangeCommand}"></RadioButton>
                                    <TextBlock Text="按特定页面拆分" VerticalAlignment="Center"></TextBlock>
                                    <cus:WritableComboBox x:Name="PageRangeComboBox"  Height="32" Width="183" Text="{Binding PageRangeText, Mode=TwoWay}" IsEnabled="{Binding CustomPageRangeIsEnabled}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange,Mode=TwoWay}">
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="SelectionChanged">
                                                <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=SplitPreview}" />
                                            </i:EventTrigger>
                                            <i:EventTrigger EventName="TextChanged">
                                                <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=SplitPreview}" />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </cus:WritableComboBox>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                        <Grid Grid.Row="1">
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="文档命名" Height="22" Width="56" HorizontalAlignment="Left"></TextBlock>
                                <TextBlock Height="32" Width="303" Margin="0,0,0,6" Text="{Binding FilePathName}"></TextBlock>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,13">
                                    <CheckBox Margin="0,0,11,0" Command="{Binding FrontFileNameCommand}" IsChecked="{Binding FrontFileIsCheck}"></CheckBox>
                                    <TextBlock Text="将原始文档名前置"></TextBlock>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
                                    <CheckBox VerticalAlignment="Center" Margin="0,0,11,0" Command="{Binding FileNameLabelCommand}" IsChecked="{Binding FileNameLabelIsCheck}"></CheckBox>
                                    <TextBlock Text="标签" VerticalAlignment="Center" Margin="0,0,30,0"></TextBlock>
                                    <TextBox x:Name="FileNameLabelTextBox" Height="32" Width="110" Text="{Binding FileNameLabelText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameLabelIsEnabled}"></TextBox>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <CheckBox VerticalAlignment="Center" Margin="0,0,11,0"  Command="{Binding FileNameDeimiterCommand}" IsChecked="{Binding FileNameDeimiterIsCheck}"></CheckBox>
                                    <TextBlock Text="分隔符" VerticalAlignment="Center" Margin="0,0,18,0"></TextBlock>
                                    <TextBox x:Name="FileNameDeimiterTextBox"  Height="32" Width="110" Text="{Binding FileNameDeimiterText}" TextChanged="TextBox_TextChanged" IsEnabled="{Binding FileNameDeimiterIsEnabled}"></TextBox>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
        </cus:DialogContent.Content>
        <cus:DialogContent.BottmBar>
            <Grid>
                <Button
                    Width="98"
                    Height="32"
                    Margin="16,0"
                    HorizontalAlignment="Right"
                    Command="{Binding CancelCommand}"
                    Content="取消" />
                <Button
                    Width="98"
                    Height="32"
                    Margin="124,0"
                    HorizontalAlignment="Right"
                    Command="{Binding SplitCommand}"
                    Content="拆分" />
            </Grid>
        </cus:DialogContent.BottmBar>
    </cus:DialogContent>
</UserControl>