SplitDialog.xaml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <UserControl
  2. x:Class="PDF_Office.Views.Dialog.PageEditDialogs.SplitDialog"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
  10. xmlns:prism="http://prismlibrary.com/"
  11. Width="480"
  12. Height="481"
  13. d:DataContext="{d:DesignInstance Type=pageeditdialogs:SplitDialogViewModel}"
  14. d:DesignHeight="450"
  15. d:DesignWidth="800"
  16. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. mc:Ignorable="d">
  19. <cus:DialogContent Header="拆分页面">
  20. <cus:DialogContent.Content>
  21. <Grid>
  22. <Grid.RowDefinitions>
  23. <RowDefinition />
  24. <RowDefinition />
  25. </Grid.RowDefinitions>
  26. <StackPanel Margin="16,4,16,0">
  27. <TextBlock
  28. Margin="0,12"
  29. FontSize="14"
  30. FontWeight="SemiBold"
  31. Text="拆分方式" />
  32. <StackPanel Orientation="Horizontal">
  33. <RadioButton
  34. Name="RbtnPage"
  35. VerticalAlignment="Center"
  36. Content="平均每"
  37. GroupName="SplitMode"
  38. IsChecked="True" />
  39. <cus:NumericUpDown
  40. Margin="8,0"
  41. IsEnabled="{Binding ElementName=RbtnPage, Path=IsChecked}"
  42. Minimum="1" />
  43. <TextBlock VerticalAlignment="Center" Text="页拆分为一个PDF文件" />
  44. </StackPanel>
  45. <StackPanel Margin="0,12" Orientation="Horizontal">
  46. <RadioButton
  47. Name="RbtnPdf"
  48. VerticalAlignment="Center"
  49. Content="平均拆分为"
  50. GroupName="SplitMode" />
  51. <cus:NumericUpDown
  52. Margin="8,0"
  53. IsEnabled="{Binding ElementName=RbtnPdf, Path=IsChecked}"
  54. Minimum="1" />
  55. <TextBlock VerticalAlignment="Center" Text="个PDF文件" />
  56. </StackPanel>
  57. <StackPanel Margin="0,0,0,12" Orientation="Horizontal">
  58. <RadioButton
  59. x:Name="RbtnPagerange"
  60. VerticalAlignment="Center"
  61. Content="按页面范围拆分"
  62. GroupName="SplitMode" />
  63. <ComboBox
  64. Width="110"
  65. Margin="8,0"
  66. IsEnabled="{Binding ElementName=RbtnPagerange, Path=IsChecked}" />
  67. </StackPanel>
  68. </StackPanel>
  69. <StackPanel Grid.Row="1" Margin="16,0">
  70. <TextBlock
  71. FontSize="14"
  72. FontWeight="SemiBold"
  73. LineHeight="22"
  74. Text="文档命名" />
  75. <TextBox
  76. Width="346"
  77. Height="32"
  78. HorizontalAlignment="Left"
  79. VerticalContentAlignment="Center"
  80. BorderThickness="1"
  81. Focusable="False"
  82. FontSize="14"
  83. IsReadOnly="True"
  84. Text="{Binding Model.FileName}" />
  85. <CheckBox
  86. Margin="0,6"
  87. VerticalContentAlignment="Center"
  88. Content="将原始文档名前置"
  89. FontSize="14"
  90. IsChecked="{Binding Model.IsSourceNameFront}" />
  91. <StackPanel Margin="0,8" Orientation="Horizontal">
  92. <CheckBox
  93. Name="ChkSign"
  94. Width="{Binding ElementName=ChkSeparator, Path=ActualWidth}"
  95. Margin="0,6"
  96. VerticalContentAlignment="Center"
  97. Content="标签"
  98. FontSize="14"
  99. IsChecked="{Binding Model.HasLabel}" />
  100. <TextBox
  101. Width="110"
  102. Height="32"
  103. Margin="16,0"
  104. VerticalContentAlignment="Center"
  105. IsEnabled="{Binding ElementName=ChkSign, Path=IsChecked}"
  106. Text="{Binding Model.FileNameLabel, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  107. </StackPanel>
  108. <StackPanel Orientation="Horizontal">
  109. <CheckBox
  110. Name="ChkSeparator"
  111. Margin="0,6"
  112. VerticalContentAlignment="Center"
  113. Content="分隔符"
  114. FontSize="14"
  115. IsChecked="{Binding Model.HasDeimiter}" />
  116. <TextBox
  117. Width="110"
  118. Height="32"
  119. Margin="16,0"
  120. VerticalContentAlignment="Center"
  121. IsEnabled="{Binding ElementName=ChkSeparator, Path=IsChecked}"
  122. Text="{Binding Model.FileNameDeimiter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  123. </StackPanel>
  124. </StackPanel>
  125. </Grid>
  126. </cus:DialogContent.Content>
  127. <cus:DialogContent.BottmBar>
  128. <Grid>
  129. <Button
  130. Width="98"
  131. Height="32"
  132. Margin="16,0"
  133. HorizontalAlignment="Right"
  134. Command="{Binding CancelCommand}"
  135. Content="取消" />
  136. <Button
  137. Width="98"
  138. Height="32"
  139. Margin="124,0"
  140. HorizontalAlignment="Right"
  141. Command="{Binding SplitCommnad}"
  142. Content="拆分" />
  143. </Grid>
  144. </cus:DialogContent.BottmBar>
  145. </cus:DialogContent>
  146. </UserControl>