SplitDialog.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <UserControl
  2. x:Class="PDF_Master.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_Master.CustomControl"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Master.Views.Dialog.PageEditDialogs"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
  10. xmlns:prism="http://prismlibrary.com/"
  11. Width="468"
  12. Height="464"
  13. d:DataContext="{d:DesignInstance Type=pageeditdialogs:SplitDialogViewModel}"
  14. d:DesignHeight="464"
  15. d:DesignWidth="468"
  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,0,16,10">
  27. <TextBlock
  28. FontFamily="Segoe UI"
  29. FontSize="12"
  30. FontWeight="SemiBold"
  31. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  32. Text="拆分方式" />
  33. <StackPanel Margin="0,15" Orientation="Horizontal">
  34. <RadioButton
  35. Name="RbtnPage"
  36. Height="24"
  37. VerticalAlignment="Center"
  38. VerticalContentAlignment="Center"
  39. Content="平均每"
  40. FontFamily="Segoe UI"
  41. FontSize="14"
  42. GroupName="SplitMode"
  43. IsChecked="{Binding Model.IsAveragePages, Mode=TwoWay}" />
  44. <cus:NumericUpDown
  45. Width="80"
  46. Height="32"
  47. Margin="8,0"
  48. IsEnabled="{Binding ElementName=RbtnPage, Path=IsChecked}"
  49. Maximum="{Binding PageCount}"
  50. Minimum="1"
  51. Value="{Binding Model.PageNum, Mode=TwoWay}" />
  52. <TextBlock
  53. VerticalAlignment="Center"
  54. FontFamily="Segoe UI"
  55. FontSize="14"
  56. Text="页拆分为一个PDF文件" />
  57. </StackPanel>
  58. <StackPanel Margin="0,0,0,15" Orientation="Horizontal">
  59. <RadioButton
  60. Name="RbtnPdf"
  61. VerticalAlignment="Center"
  62. VerticalContentAlignment="Center"
  63. Content="平均拆分为"
  64. FontFamily="Segoe UI"
  65. FontSize="14"
  66. GroupName="SplitMode"
  67. IsChecked="{Binding Model.IsAveragePDF, Mode=TwoWay}" />
  68. <cus:NumericUpDown
  69. Width="80"
  70. Height="32"
  71. Margin="8,0"
  72. IsEnabled="{Binding ElementName=RbtnPdf, Path=IsChecked}"
  73. Maximum="{Binding PageCount}"
  74. Minimum="1"
  75. Value="{Binding Model.FilesCount, Mode=TwoWay}" />
  76. <TextBlock
  77. VerticalAlignment="Center"
  78. FontFamily="Segoe UI"
  79. FontSize="14"
  80. Text="个PDF文件" />
  81. </StackPanel>
  82. <StackPanel Margin="0,0,0,15" Orientation="Horizontal">
  83. <RadioButton
  84. x:Name="RbtnPagerange"
  85. VerticalAlignment="Center"
  86. VerticalContentAlignment="Center"
  87. Content="按页面范围拆分"
  88. FontFamily="Segoe UI"
  89. FontSize="14"
  90. GroupName="SplitMode"
  91. IsChecked="{Binding Model.IsCustomRange, Mode=TwoWay}" />
  92. <cus:WritableComboBox
  93. Width="160"
  94. Height="32"
  95. Margin="8,0"
  96. IsAllPageVisible="Collapsed"
  97. IsEnabled="{Binding ElementName=RbtnPagerange, Path=IsChecked}"
  98. MaxPageRange="{Binding PageCount}"
  99. SelectedIndex="{Binding Model.PageSelectedIndex, Mode=TwoWay}"
  100. Text="{Binding CustomPageText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  101. </StackPanel>
  102. </StackPanel>
  103. <StackPanel Grid.Row="1" Margin="16,0">
  104. <TextBlock
  105. Margin="0,0,0,10"
  106. FontFamily="Segoe UI"
  107. FontSize="12"
  108. FontWeight="SemiBold"
  109. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  110. Text="文档命名" />
  111. <TextBox
  112. Width="360"
  113. Height="32"
  114. HorizontalAlignment="Left"
  115. VerticalContentAlignment="Center"
  116. BorderThickness="1"
  117. Focusable="False"
  118. FontFamily="Segoe UI"
  119. FontSize="14"
  120. IsReadOnly="True"
  121. Text="{Binding Model.FileName}">
  122. <TextBox.Resources>
  123. <Style TargetType="{x:Type Border}">
  124. <Setter Property="CornerRadius" Value="4" />
  125. </Style>
  126. </TextBox.Resources>
  127. </TextBox>
  128. <CheckBox
  129. Width="400"
  130. Height="22"
  131. Margin="0,8"
  132. HorizontalAlignment="Left"
  133. VerticalContentAlignment="Center"
  134. Content="将原始文档名前置"
  135. FontFamily="Segoe UI"
  136. FontSize="14"
  137. IsChecked="{Binding Model.IsSourceNameFront}" />
  138. <StackPanel Margin="0,0,0,8" Orientation="Horizontal">
  139. <CheckBox
  140. Name="ChkSign"
  141. Width="{Binding ElementName=ChkSeparator, Path=ActualWidth}"
  142. Margin="0,6"
  143. VerticalContentAlignment="Center"
  144. Content="标签"
  145. FontFamily="Segoe UI"
  146. FontSize="14"
  147. IsChecked="{Binding Model.HasLabel}" />
  148. <TextBox
  149. Width="120"
  150. Height="32"
  151. Margin="16,0"
  152. VerticalContentAlignment="Center"
  153. IsEnabled="{Binding ElementName=ChkSign, Path=IsChecked}"
  154. Text="{Binding Model.FileNameLabel, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  155. <TextBox.Resources>
  156. <Style TargetType="{x:Type Border}">
  157. <Setter Property="CornerRadius" Value="4" />
  158. </Style>
  159. </TextBox.Resources>
  160. </TextBox>
  161. </StackPanel>
  162. <StackPanel Orientation="Horizontal">
  163. <CheckBox
  164. Name="ChkSeparator"
  165. Margin="0,6"
  166. VerticalContentAlignment="Center"
  167. Content="分隔符"
  168. FontFamily="Segoe UI"
  169. FontSize="14"
  170. IsChecked="{Binding Model.HasDeimiter}" />
  171. <TextBox
  172. Width="120"
  173. Height="32"
  174. Margin="16,0"
  175. VerticalContentAlignment="Center"
  176. IsEnabled="{Binding ElementName=ChkSeparator, Path=IsChecked}"
  177. Text="{Binding Model.FileNameDeimiter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  178. <TextBox.Resources>
  179. <Style TargetType="{x:Type Border}">
  180. <Setter Property="CornerRadius" Value="4" />
  181. </Style>
  182. </TextBox.Resources>
  183. </TextBox>
  184. </StackPanel>
  185. </StackPanel>
  186. </Grid>
  187. </cus:DialogContent.Content>
  188. <cus:DialogContent.BottmBar>
  189. <Grid>
  190. <Button
  191. Width="98"
  192. Height="32"
  193. Margin="16,0"
  194. HorizontalAlignment="Right"
  195. Command="{Binding CancelCommand}"
  196. Content="取消"
  197. Style="{StaticResource btn.sec}" />
  198. <Button
  199. Width="98"
  200. Height="32"
  201. Margin="124,0"
  202. HorizontalAlignment="Right"
  203. Command="{Binding SplitCommnad}"
  204. Content="拆分"
  205. Style="{StaticResource Btn.cta}" />
  206. </Grid>
  207. </cus:DialogContent.BottmBar>
  208. </cus:DialogContent>
  209. </UserControl>