CropWindow.xaml 6.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <Window x:Class="ComPDFKitDemo.PageEditor.CropWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:ComPDFKitDemo.PageEditor"
  7. mc:Ignorable="d"
  8. Title="CropWindow" Height="520" Width="600" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" ResizeMode="CanMinimize">
  9. <Grid>
  10. <Grid.ColumnDefinitions>
  11. <ColumnDefinition Width="200"></ColumnDefinition>
  12. <ColumnDefinition Width="*"></ColumnDefinition>
  13. </Grid.ColumnDefinitions>
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="auto"></RowDefinition>
  16. <RowDefinition Height="auto"></RowDefinition>
  17. </Grid.RowDefinitions>
  18. <Border BorderThickness="1" BorderBrush="LightGray" Margin="10" Padding="10,5,10,5">
  19. <Grid>
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="auto"></RowDefinition>
  22. <RowDefinition Height="auto"></RowDefinition>
  23. <RowDefinition Height="auto"></RowDefinition>
  24. </Grid.RowDefinitions>
  25. <ComboBox Name="CropTypeBox">
  26. <ComboBoxItem Content="MediaBox"></ComboBoxItem>
  27. <ComboBoxItem Content="CropBox" IsSelected="True"></ComboBoxItem>
  28. <ComboBoxItem Content="BleedBox"></ComboBoxItem>
  29. <ComboBoxItem Content="TrimBox"></ComboBoxItem>
  30. <ComboBoxItem Content="ArtBox"></ComboBoxItem>
  31. </ComboBox>
  32. <Grid Grid.Row="1">
  33. <Grid.ColumnDefinitions>
  34. <ColumnDefinition Width="auto"></ColumnDefinition>
  35. <ColumnDefinition Width="*"></ColumnDefinition>
  36. </Grid.ColumnDefinitions>
  37. <Grid.RowDefinitions>
  38. <RowDefinition Height="auto"></RowDefinition>
  39. <RowDefinition Height="auto"></RowDefinition>
  40. <RowDefinition Height="auto"></RowDefinition>
  41. <RowDefinition Height="auto"></RowDefinition>
  42. <RowDefinition Height="auto"></RowDefinition>
  43. <RowDefinition Height="auto"></RowDefinition>
  44. </Grid.RowDefinitions>
  45. <TextBlock Grid.ColumnSpan="2" Margin="10,10,0,10">Constrain Proportions:</TextBlock>
  46. <TextBlock Grid.Row="1" Width="50" Margin="10,20,0 0">Left:</TextBlock>
  47. <TextBox Name="LeftText" InputScope="Number" Grid.Row="1" Height="20" Grid.Column="1" Margin="10,20,0 0" IsReadOnly="{Binding ElementName=EnableCheck,Path=IsChecked}" TextAlignment="Center"></TextBox>
  48. <TextBlock Grid.Row="2" Width="50" Margin="10,20,0 0">Top:</TextBlock>
  49. <TextBox Name="TopText" InputScope="Number" Grid.Row="2" Height="20" Grid.Column="1" Margin="10,20,0 0" IsReadOnly="{Binding ElementName=EnableCheck,Path=IsChecked}" TextAlignment="Center"></TextBox>
  50. <TextBlock Grid.Row="3" Width="50" Margin="10,20,0 0">Right:</TextBlock>
  51. <TextBox Name="RightText" InputScope="Number" Grid.Row="3" Height="20" Grid.Column="1" Margin="10,20,0 0" IsReadOnly="{Binding ElementName=EnableCheck,Path=IsChecked}" TextAlignment="Center"></TextBox>
  52. <TextBlock Grid.Row="4" Width="50" Margin="10,20,0 0">Bottom:</TextBlock>
  53. <TextBox Name="BottomText" InputScope="Number" Grid.Row="4" Height="20" Grid.Column="1" Margin="10,20,0 0" IsReadOnly="{Binding ElementName=EnableCheck,Path=IsChecked}" TextAlignment="Center"></TextBox>
  54. <StackPanel Grid.Row="5" Grid.ColumnSpan="2" Margin="10,10,0 0">
  55. <CheckBox Name="EnableCheck">Disable Input</CheckBox>
  56. <Button Margin="0,10,0,0" Click="RefreshButton_Click">Refresh</Button>
  57. </StackPanel>
  58. </Grid>
  59. <Grid Grid.Row="2">
  60. <Grid.RowDefinitions>
  61. <RowDefinition Height="auto"></RowDefinition>
  62. <RowDefinition Height="auto"></RowDefinition>
  63. <RowDefinition Height="auto"></RowDefinition>
  64. <RowDefinition Height="auto"></RowDefinition>
  65. </Grid.RowDefinitions>
  66. <TextBlock Grid.ColumnSpan="2" Margin="10,20,0,10">Page Ranges:</TextBlock>
  67. <RadioButton Grid.Row="1" Margin="10,5,0,10" Checked="RadioButton_Checked" Tag="AllRadioBtn">All Pages</RadioButton>
  68. <RadioButton Name="RangeRadioBtn" Grid.Row="2" Margin="10,5,0,10" IsChecked="True" Checked="RadioButton_Checked" Tag="RangeRadioBtn">Ranges</RadioButton>
  69. <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="5,10,0,10">
  70. <TextBox Name="StartPageText" Width="40" Height="20" TextAlignment="Center"></TextBox>
  71. <TextBlock Padding="3,0,3,0"> To</TextBlock>
  72. <TextBox Name="EndPageText" Width="40" Height="20" TextAlignment="Center"></TextBox>
  73. <TextBlock Name="PageCountText" Padding="3,0,0,0"></TextBlock>
  74. </StackPanel>
  75. </Grid>
  76. </Grid>
  77. </Border>
  78. <Border Grid.Column="1" BorderThickness="1" BorderBrush="LightGray" Margin="10" Padding="10,5,10,5">
  79. <local:CropControl x:Name="CropUI" CropChanged="CropUI_CropChanged">
  80. </local:CropControl>
  81. </Border>
  82. <StackPanel Grid.Row="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
  83. <Button Padding="20,2,20,2" Margin="0,5,10,5" Click="SaveButton_Click">Ok</Button>
  84. <Button Padding="10,2,10,2" Margin="0,5,10,5" Click="CancelButton_Click">Cancel</Button>
  85. </StackPanel>
  86. </Grid>
  87. </Window>