SplitDialog.xaml 11 KB

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