123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <UserControl x:Class="ComPDFKit.Controls.PDFControlUI.CPDFPageInsertUI"
- 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.Controls.PDFControlUI"
- xmlns:cpdfcommon="clr-namespace:ComPDFKit.Controls.Common"
- mc:Ignorable="d"
- d:DesignHeight="490" d:DesignWidth="432">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
- <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
- </ResourceDictionary.MergedDictionaries>
- <cpdfcommon:BoolToVisibleConverter x:Key="BoolToVisibleConverter"></cpdfcommon:BoolToVisibleConverter>
- <cpdfcommon:ReverseVisibilityConverter x:Key="ReverseVisibilityConverter"></cpdfcommon:ReverseVisibilityConverter>
- <cpdfcommon:DocEditorResourceConverter x:Key="DocEditorResourceConverter"></cpdfcommon:DocEditorResourceConverter>
- <cpdfcommon:OrMultiBoolValueConverter x:Key="AndMultiBoolValueConverter"></cpdfcommon:OrMultiBoolValueConverter>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="30"></RowDefinition>
- <RowDefinition></RowDefinition>
- <RowDefinition></RowDefinition>
- <RowDefinition Height="57"></RowDefinition>
- </Grid.RowDefinitions>
- <TextBlock FontSize="14" Margin="12,6" HorizontalAlignment="Left" VerticalAlignment="Top"
- Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Title_Insert}"></TextBlock>
- <Grid Grid.Row="1">
- <Border BorderBrush="#1A000000" BorderThickness="1" Width="382" Height="170">
- <Grid Margin="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="70"></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <StackPanel Margin="0,5,0,0">
- <RadioButton GroupName="PageInsert" IsChecked="True" Name="BlankPagesCheckBox" Tag="BlankPages" Click="InsertTypeCheckBox_Click">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_Blank}"></TextBlock>
- </RadioButton>
- <RadioButton GroupName="PageInsert" Name="CustomBlankPagesCheckBox" Tag="CustomBlankPages" Margin="0,10,0,10" Click="InsertTypeCheckBox_Click">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_Custom}"></TextBlock>
- </RadioButton>
- <RadioButton GroupName="PageInsert" x:Name="OtherFileRadioButton" Tag="FromOtherPDF" Click="InsertTypeCheckBox_Click">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_From}"></TextBlock>
- </RadioButton>
- </StackPanel>
- <Grid Grid.Row="1" Grid.ColumnSpan="2">
- <StackPanel x:Name="OtherFilePanel" Orientation="Vertical" Visibility="{Binding IsChecked, ElementName=OtherFileRadioButton, Converter={StaticResource BoolToVisibleConverter}}">
- <StackPanel Orientation="Horizontal" Margin="0,6,0,0" IsEnabled="{Binding ElementName=OtherFileRadioButton, Path=IsChecked}">
- <Button x:Name="SelectFileButton" Width="75" Content="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Button_Select}" Click="SelectFileButton_Click"></Button>
- <TextBox x:Name="FilePathTextBox" Width="230" Height="28" Margin="8,0,0,0" IsReadOnly="True" VerticalContentAlignment="Center"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" Margin="0,6,0,0" IsEnabled="{Binding ElementName=OtherFileRadioButton, Path=IsChecked}">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Text_Range}" Width="83" VerticalAlignment="Center"></TextBlock>
- <cpdfcommon:WritableComboBoxControl x:Name="WritableComboBoxControl" Width="230" Margin="0,0,0,0" Loaded="WritableComboBoxControl_Loaded" Unloaded="WritableComboBoxControl_Unloaded"></cpdfcommon:WritableComboBoxControl>
- </StackPanel>
- </StackPanel>
- <ComboBox x:Name="PageSizeComboBox" Width="230" Height="28" Style="{StaticResource ComboBoxStyle1}" HorizontalAlignment="Left" VerticalAlignment="Top" Visibility="{Binding Visibility, ElementName=OtherFilePanel, Converter={StaticResource ReverseVisibilityConverter}}" IsEnabled="{Binding ElementName=CustomBlankPagesCheckBox, Path=IsChecked}" SelectionChanged="PageSizeComboBox_SelectionChanged" VerticalContentAlignment="Center" Margin="19,5,0,0">
- <ComboBoxItem Content="A3"></ComboBoxItem>
- <ComboBoxItem Content="A4" IsSelected="True"></ComboBoxItem>
- <ComboBoxItem Content="A5"></ComboBoxItem>
- </ComboBox>
- <Border Height="20" Visibility="{Binding ElementName=BlankPagesCheckBox, Path=IsChecked, Converter={StaticResource BoolToVisibleConverter}}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="24,9,0,0" Background="#EFEFEF"></Border>
- </Grid>
- </Grid>
- </Border>
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Subtitle_Pages}" FontFamily="Microsoft YaHei" Margin="40,0,0,0" Background="White" Height="16" VerticalAlignment="Top" HorizontalAlignment="Left" FontWeight="Bold"></TextBlock>
- </Grid>
- <Grid Grid.Row="2">
- <Border BorderBrush="#1A000000" BorderThickness="1" Width="382" Height="184">
- <Grid Margin="10,10,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="40"></RowDefinition>
- <RowDefinition Height="40"></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <RadioButton GroupName="PageLocation" Name="HomePageRadioButton" Tag="HomePage" Margin="0,10,0,10" IsChecked="True" Click="PageInsertLocation_Click">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_First}"></TextBlock>
- </RadioButton>
- <RadioButton GroupName="PageLocation" Name="GastricPageRadioButton" Tag="GastricPage" Grid.Row="1" Margin="0,10,0,10" Click="PageInsertLocation_Click">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_Last}"></TextBlock>
- </RadioButton>
- <StackPanel Grid.Row="2" Margin="0,8,0,10">
- <StackPanel Orientation="Horizontal">
- <RadioButton GroupName="PageLocation" Name="CustomPageRadioButton" Tag="CustomPage" VerticalAlignment="Center" Click="PageInsertLocation_Click">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_Page}"/>
- </RadioButton>
- <cpdfcommon:NumericUpDownControl x:Name="PageTextBox" Maximum="{Binding MaxIndex, Mode=OneWay}" Minimum="1" Text="{Binding CustomPageIndex, Mode=TwoWay}" Height="32" Width="175" Margin="12,0,0,0" IsEnabled="{Binding ElementName=CustomPageRadioButton, Path= IsChecked}"/>
- <TextBlock Text="/" VerticalAlignment="Center" Margin="8,0,0,0" ></TextBlock>
- <TextBlock x:Name="MaxPageTextBox" Text="10000" VerticalAlignment="Center" ></TextBlock>
- </StackPanel>
- <ComboBox x:Name="PageLocationComboBox" Width="215" Height="32" HorizontalAlignment="Left" Margin="20,8,0,0" Style="{StaticResource ComboBoxStyle1}" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=CustomPageRadioButton, Path= IsChecked}" SelectionChanged="PageLocationComboBox_SelectionChanged">
- <ComboBoxItem Content="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_After }" IsSelected="True"></ComboBoxItem>
- <ComboBoxItem Content="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Option_Before}"></ComboBoxItem>
- </ComboBox>
- </StackPanel>
- </Grid>
- </Border>
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Subtitle_Pos}" FontFamily="Microsoft YaHei" Margin="40,-4,0,0" Background="White" Height="16" VerticalAlignment="Top" HorizontalAlignment="Left" FontWeight="Bold"></TextBlock>
- </Grid>
- <StackPanel HorizontalAlignment="Right" Grid.Row="3" Orientation="Horizontal" Margin="0,0,25,0">
- <Button x:Name="CancelButton" Height="32" Width="112" Click="CancelButton_Click">
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Button_Cancel}"></TextBlock>
- </Button>
- <Button x:Name="InsertButton" Height="32" Width="112" Margin="8,0,0,0" Click="InsertButton_Click">
- <Button.Content>
- <TextBlock Text="{Binding Converter={StaticResource DocEditorResourceConverter},ConverterParameter=Button_Insert}"></TextBlock>
- </Button.Content>
- <Button.IsEnabled>
- <MultiBinding Converter="{StaticResource AndMultiBoolValueConverter}">
- <Binding ElementName="HomePageRadioButton" Path="IsChecked"></Binding>
- <Binding ElementName="GastricPageRadioButton" Path="IsChecked"></Binding>
- <Binding ElementName="PageTextBox" Path="IsValueValid"></Binding>
- </MultiBinding>
- </Button.IsEnabled>
- </Button>
- </StackPanel>
- </Grid>
- </UserControl>
|