SplitDialog.xaml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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="{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. SelectedIndex="{Binding Model.PageSelectedIndex, Mode=TwoWay}"
  78. Text="{Binding CustomPageText, Mode=TwoWay}" />
  79. </StackPanel>
  80. </StackPanel>
  81. <StackPanel Grid.Row="1" Margin="16,0">
  82. <TextBlock
  83. FontSize="14"
  84. FontWeight="SemiBold"
  85. LineHeight="22"
  86. Text="文档命名" />
  87. <TextBox
  88. Width="346"
  89. Height="32"
  90. HorizontalAlignment="Left"
  91. VerticalContentAlignment="Center"
  92. BorderThickness="1"
  93. Focusable="False"
  94. FontSize="14"
  95. IsReadOnly="True"
  96. Text="{Binding Model.FileName}" />
  97. <CheckBox
  98. Margin="0,6"
  99. VerticalContentAlignment="Center"
  100. Content="将原始文档名前置"
  101. FontSize="14"
  102. IsChecked="{Binding Model.IsSourceNameFront}" />
  103. <StackPanel Margin="0,8" Orientation="Horizontal">
  104. <CheckBox
  105. Name="ChkSign"
  106. Width="{Binding ElementName=ChkSeparator, Path=ActualWidth}"
  107. Margin="0,6"
  108. VerticalContentAlignment="Center"
  109. Content="标签"
  110. FontSize="14"
  111. IsChecked="{Binding Model.HasLabel}" />
  112. <TextBox
  113. Width="110"
  114. Height="32"
  115. Margin="16,0"
  116. VerticalContentAlignment="Center"
  117. IsEnabled="{Binding ElementName=ChkSign, Path=IsChecked}"
  118. Text="{Binding Model.FileNameLabel, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  119. </StackPanel>
  120. <StackPanel Orientation="Horizontal">
  121. <CheckBox
  122. Name="ChkSeparator"
  123. Margin="0,6"
  124. VerticalContentAlignment="Center"
  125. Content="分隔符"
  126. FontSize="14"
  127. IsChecked="{Binding Model.HasDeimiter}" />
  128. <TextBox
  129. Width="110"
  130. Height="32"
  131. Margin="16,0"
  132. VerticalContentAlignment="Center"
  133. IsEnabled="{Binding ElementName=ChkSeparator, Path=IsChecked}"
  134. Text="{Binding Model.FileNameDeimiter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  135. </StackPanel>
  136. </StackPanel>
  137. </Grid>
  138. </cus:DialogContent.Content>
  139. <cus:DialogContent.BottmBar>
  140. <Grid>
  141. <Button
  142. Width="98"
  143. Height="32"
  144. Margin="16,0"
  145. HorizontalAlignment="Right"
  146. Command="{Binding CancelCommand}"
  147. Content="取消" />
  148. <Button
  149. Width="98"
  150. Height="32"
  151. Margin="124,0"
  152. HorizontalAlignment="Right"
  153. Command="{Binding SplitCommnad}"
  154. Content="拆分" />
  155. </Grid>
  156. </cus:DialogContent.BottmBar>
  157. </cus:DialogContent>
  158. </UserControl>