SplitDialog.xaml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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="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="{Binding Model.IsAveragePages, Mode=TwoWay}" />
  39. <cus:NumericUpDown
  40. Height="32"
  41. Margin="8,0"
  42. IsEnabled="{Binding ElementName=RbtnPage, Path=IsChecked}"
  43. Maximum="{Binding PageCount}"
  44. Minimum="1"
  45. Value="{Binding Model.PageNum, Mode=TwoWay}" />
  46. <TextBlock VerticalAlignment="Center" Text="页拆分为一个PDF文件" />
  47. </StackPanel>
  48. <StackPanel Margin="0,12" Orientation="Horizontal">
  49. <RadioButton
  50. Name="RbtnPdf"
  51. VerticalAlignment="Center"
  52. Content="平均拆分为"
  53. GroupName="SplitMode"
  54. IsChecked="{Binding Model.IsAveragePDF, Mode=TwoWay}" />
  55. <cus:NumericUpDown
  56. Height="32"
  57. Margin="8,0"
  58. IsEnabled="{Binding ElementName=RbtnPdf, Path=IsChecked}"
  59. Maximum="{Binding PageCount}"
  60. Minimum="1"
  61. Value="{Binding Model.FilesCount, Mode=TwoWay}" />
  62. <TextBlock VerticalAlignment="Center" Text="个PDF文件" />
  63. </StackPanel>
  64. <StackPanel Margin="0,0,0,12" Orientation="Horizontal">
  65. <RadioButton
  66. x:Name="RbtnPagerange"
  67. VerticalAlignment="Center"
  68. Content="按页面范围拆分"
  69. GroupName="SplitMode"
  70. IsChecked="{Binding Model.IsCustomRange, Mode=TwoWay}" />
  71. <cus:WritableComboBox
  72. Width="110"
  73. Height="32"
  74. Margin="8,0"
  75. IsAllPageVisible="Collapsed"
  76. IsEnabled="{Binding ElementName=RbtnPagerange, Path=IsChecked}"
  77. MaxPageRange="{Binding PageCount}"
  78. SelectedIndex="{Binding Model.PageSelectedIndex, Mode=TwoWay}"
  79. Text="{Binding CustomPageText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  80. </StackPanel>
  81. </StackPanel>
  82. <StackPanel Grid.Row="1" Margin="16,0">
  83. <TextBlock
  84. FontSize="14"
  85. FontWeight="SemiBold"
  86. LineHeight="22"
  87. Text="文档命名" />
  88. <TextBox
  89. Width="346"
  90. Height="32"
  91. HorizontalAlignment="Left"
  92. VerticalContentAlignment="Center"
  93. BorderThickness="1"
  94. Focusable="False"
  95. FontSize="14"
  96. IsReadOnly="True"
  97. Text="{Binding Model.FileName}" />
  98. <CheckBox
  99. Margin="0,6"
  100. VerticalContentAlignment="Center"
  101. Content="将原始文档名前置"
  102. FontSize="14"
  103. IsChecked="{Binding Model.IsSourceNameFront}" />
  104. <StackPanel Margin="0,8" Orientation="Horizontal">
  105. <CheckBox
  106. Name="ChkSign"
  107. Width="{Binding ElementName=ChkSeparator, Path=ActualWidth}"
  108. Margin="0,6"
  109. VerticalContentAlignment="Center"
  110. Content="标签"
  111. FontSize="14"
  112. IsChecked="{Binding Model.HasLabel}" />
  113. <TextBox
  114. Width="110"
  115. Height="32"
  116. Margin="16,0"
  117. VerticalContentAlignment="Center"
  118. IsEnabled="{Binding ElementName=ChkSign, Path=IsChecked}"
  119. Text="{Binding Model.FileNameLabel, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  120. </StackPanel>
  121. <StackPanel Orientation="Horizontal">
  122. <CheckBox
  123. Name="ChkSeparator"
  124. Margin="0,6"
  125. VerticalContentAlignment="Center"
  126. Content="分隔符"
  127. FontSize="14"
  128. IsChecked="{Binding Model.HasDeimiter}" />
  129. <TextBox
  130. Width="110"
  131. Height="32"
  132. Margin="16,0"
  133. VerticalContentAlignment="Center"
  134. IsEnabled="{Binding ElementName=ChkSeparator, Path=IsChecked}"
  135. Text="{Binding Model.FileNameDeimiter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  136. </StackPanel>
  137. </StackPanel>
  138. </Grid>
  139. </cus:DialogContent.Content>
  140. <cus:DialogContent.BottmBar>
  141. <Grid>
  142. <Button
  143. Width="98"
  144. Height="32"
  145. Margin="16,0"
  146. HorizontalAlignment="Right"
  147. Command="{Binding CancelCommand}"
  148. Content="取消" />
  149. <Button
  150. Width="98"
  151. Height="32"
  152. Margin="124,0"
  153. HorizontalAlignment="Right"
  154. Command="{Binding SplitCommnad}"
  155. Content="拆分" />
  156. </Grid>
  157. </cus:DialogContent.BottmBar>
  158. </cus:DialogContent>
  159. </UserControl>