CPDFPageInsertUI.xaml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <UserControl x:Class="Compdfkit_Tools.PDFControlUI.CPDFPageInsertUI"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:Compdfkit_Tools.PDFControlUI"
  7. xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
  8. mc:Ignorable="d"
  9. d:DesignHeight="490" d:DesignWidth="432">
  10. <UserControl.Resources>
  11. <ResourceDictionary>
  12. <ResourceDictionary.MergedDictionaries>
  13. <ResourceDictionary Source="../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  14. <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
  15. </ResourceDictionary.MergedDictionaries>
  16. <cpdfcommon:BoolToVisibleConverter x:Key="BoolToVisibleConverter"></cpdfcommon:BoolToVisibleConverter>
  17. <cpdfcommon:ReverseVisibilityConverter x:Key="ReverseVisibilityConverter"></cpdfcommon:ReverseVisibilityConverter>
  18. </ResourceDictionary>
  19. </UserControl.Resources>
  20. <Grid>
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="30"></RowDefinition>
  23. <RowDefinition></RowDefinition>
  24. <RowDefinition></RowDefinition>
  25. <RowDefinition Height="57"></RowDefinition>
  26. </Grid.RowDefinitions>
  27. <TextBlock Text="Insert" FontSize="14" Margin="12,6" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBlock>
  28. <Grid Grid.Row="1">
  29. <Border BorderBrush="#1A000000" BorderThickness="1" Width="382" Height="170">
  30. <Grid Margin="10">
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="70"></RowDefinition>
  33. <RowDefinition></RowDefinition>
  34. </Grid.RowDefinitions>
  35. <StackPanel Margin="0,5,0,0">
  36. <RadioButton GroupName="PageInsert" IsChecked="True" Name="BlankPagesCheckBox" Tag="BlankPages" Click="InsertTypeCheckBox_Click">
  37. <TextBlock Text="Blank Page"></TextBlock>
  38. </RadioButton>
  39. <RadioButton GroupName="PageInsert" Name="CustomBlankPagesCheckBox" Tag="CustomBlankPages" Margin="0,10,0,10" Click="InsertTypeCheckBox_Click">
  40. <TextBlock Text="Custom Blank Page"></TextBlock>
  41. </RadioButton>
  42. <RadioButton GroupName="PageInsert" x:Name="OtherFileRadioButton" Tag="FromOtherPDF" Click="InsertTypeCheckBox_Click">
  43. <TextBlock Text="From other Files"></TextBlock>
  44. </RadioButton>
  45. </StackPanel>
  46. <Grid Grid.Row="1" Grid.ColumnSpan="2">
  47. <StackPanel x:Name="OtherFilePanel" Orientation="Vertical" Visibility="{Binding IsChecked, ElementName=OtherFileRadioButton, Converter={StaticResource BoolToVisibleConverter}}">
  48. <StackPanel Orientation="Horizontal" Margin="0,6,0,0" IsEnabled="{Binding ElementName=OtherFileRadioButton, Path=IsChecked}">
  49. <Button x:Name="SelectFileButton" Width="70" Content="Select File" Click="SelectFileButton_Click"></Button>
  50. <TextBox x:Name="FilePathTextBox" Width="230" Height="28" Margin="8,0,0,0" IsReadOnly="True" VerticalContentAlignment="Center"/>
  51. </StackPanel>
  52. <StackPanel Orientation="Horizontal" Margin="0,6,0,0" IsEnabled="{Binding ElementName=OtherFileRadioButton, Path=IsChecked}">
  53. <TextBlock Text="Page Range" Width="80" VerticalAlignment="Center"></TextBlock>
  54. <cpdfcommon:WritableComboBoxControl x:Name="WritableComboBoxControl" Width="230" Margin="0,0,0,0" Loaded="WritableComboBoxControl_Loaded" Unloaded="WritableComboBoxControl_Unloaded"></cpdfcommon:WritableComboBoxControl>
  55. </StackPanel>
  56. </StackPanel>
  57. <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">
  58. <ComboBoxItem Content="A3"></ComboBoxItem>
  59. <ComboBoxItem Content="A4" IsSelected="True"></ComboBoxItem>
  60. <ComboBoxItem Content="A5"></ComboBoxItem>
  61. </ComboBox>
  62. <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>
  63. </Grid>
  64. </Grid>
  65. </Border>
  66. <TextBlock Text="Page Insert" FontFamily="Segoe UI" Margin="40,0,0,0" Background="White" Width="70" Height="16" VerticalAlignment="Top" HorizontalAlignment="Left" FontWeight="Bold"></TextBlock>
  67. </Grid>
  68. <Grid Grid.Row="2">
  69. <Border BorderBrush="#1A000000" BorderThickness="1" Width="382" Height="184">
  70. <Grid Margin="10,10,0,0">
  71. <Grid.RowDefinitions>
  72. <RowDefinition Height="40"></RowDefinition>
  73. <RowDefinition Height="40"></RowDefinition>
  74. <RowDefinition></RowDefinition>
  75. </Grid.RowDefinitions>
  76. <RadioButton GroupName="PageLocation" Name="HomePageRadioButton" Tag="HomePage" Margin="0,10,0,10" IsChecked="True" Click="PageInsertLocation_Click">
  77. <TextBlock Text="Home Page"></TextBlock>
  78. </RadioButton>
  79. <RadioButton GroupName="PageLocation" Name="GastricPageRadioButton" Tag="GastricPage" Grid.Row="1" Margin="0,10,0,10" Click="PageInsertLocation_Click">
  80. <TextBlock Text="Gastric Page"></TextBlock>
  81. </RadioButton>
  82. <StackPanel Grid.Row="2" Margin="0,8,0,10">
  83. <StackPanel Orientation="Horizontal">
  84. <RadioButton GroupName="PageLocation" Name="CustomPageRadioButton" Tag="CustomPage" VerticalAlignment="Center" Click="PageInsertLocation_Click">
  85. <TextBlock Text="Page"/>
  86. </RadioButton>
  87. <cpdfcommon:NumericUpDownControl x:Name="PageTextBox" Maxium="{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}"/>
  88. <TextBlock Text="/" VerticalAlignment="Center" Margin="8,0,0,0" ></TextBlock>
  89. <TextBlock x:Name="MaxPageTextBox" Text="10000" VerticalAlignment="Center" ></TextBlock>
  90. </StackPanel>
  91. <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">
  92. <ComboBoxItem Content="Back" IsSelected="True"></ComboBoxItem>
  93. <ComboBoxItem Content="Font"></ComboBoxItem>
  94. </ComboBox>
  95. </StackPanel>
  96. </Grid>
  97. </Border>
  98. <TextBlock Text="Page Insert Location" FontFamily="Segoe UI" Margin="40,-4,0,0" Background="White" Width="120" Height="16" VerticalAlignment="Top" HorizontalAlignment="Left" FontWeight="Bold"></TextBlock>
  99. </Grid>
  100. <StackPanel HorizontalAlignment="Right" Grid.Row="3" Orientation="Horizontal" Margin="0,0,25,0">
  101. <Button x:Name="CancelButton" Height="32" Width="112" Click="CancelButton_Click">
  102. <TextBlock Text="Cancel"></TextBlock>
  103. </Button>
  104. <Button x:Name="InsertButton" Height="32" Width="112" Margin="8,0,0,0" Click="InsertButton_Click">
  105. <TextBlock Text="Insert"></TextBlock>
  106. </Button>
  107. </StackPanel>
  108. </Grid>
  109. </UserControl>