HomePagePrinterDialog.xaml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <UserControl
  2. x:Class="PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePagePrinter.HomePagePrinterDialog"
  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:homepageprinter="clr-namespace:PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter"
  8. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:prism="http://prismlibrary.com/"
  10. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. IsEnabled="{Binding IsHitVisible}">
  13. <UserControl.Resources>
  14. <Style x:Key="PageSettingsBtnStyle" TargetType="Button">
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="{x:Type Button}">
  18. <Grid>
  19. <Border
  20. x:Name="PageSettingsBtnBorder"
  21. Background="Transparent"
  22. BorderBrush="{StaticResource color.btn.sec.border-color}"
  23. BorderThickness="1"
  24. CornerRadius="4">
  25. <Grid>
  26. <TextBlock
  27. HorizontalAlignment="Center"
  28. VerticalAlignment="Center"
  29. FontFamily="Segoe UI"
  30. FontSize="14"
  31. Text="{TemplateBinding Content}" />
  32. </Grid>
  33. </Border>
  34. </Grid>
  35. <ControlTemplate.Triggers>
  36. <Trigger Property="IsMouseOver" Value="True">
  37. <Setter TargetName="PageSettingsBtnBorder" Property="Background" Value="{StaticResource color.btn.sec.bg.hov}" />
  38. </Trigger>
  39. <Trigger Property="IsPressed" Value="True">
  40. <Setter TargetName="PageSettingsBtnBorder" Property="Background" Value="{StaticResource color.btn.sec.bg.act}" />
  41. </Trigger>
  42. </ControlTemplate.Triggers>
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. </Style>
  47. <Style x:Key="PrintModRdoStyle" TargetType="RadioButton">
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate TargetType="{x:Type RadioButton}">
  51. <Border
  52. x:Name="PrintModRdo"
  53. VerticalAlignment="Center"
  54. Background="{StaticResource color.btn.sec.bg.norm}"
  55. BorderBrush="{StaticResource color.btn.sec.border-color}"
  56. BorderThickness="1"
  57. CornerRadius="4">
  58. <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
  59. <TextBlock
  60. HorizontalAlignment="Center"
  61. VerticalAlignment="Center"
  62. FontSize="14"
  63. Foreground="{StaticResource color.btn.sec.text.def}"
  64. Text="{TemplateBinding Content}" />
  65. </Grid>
  66. </Border>
  67. <ControlTemplate.Triggers>
  68. <Trigger Property="IsMouseOver" Value="True">
  69. <Setter TargetName="PrintModRdo" Property="Background" Value="{StaticResource color.btn.sec.bg.hov}" />
  70. </Trigger>
  71. <Trigger Property="IsChecked" Value="False">
  72. <Setter TargetName="PrintModRdo" Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
  73. </Trigger>
  74. <Trigger Property="IsChecked" Value="True">
  75. <Setter TargetName="PrintModRdo" Property="Background" Value="{StaticResource color.btn.sec.bg.act}" />
  76. </Trigger>
  77. </ControlTemplate.Triggers>
  78. </ControlTemplate>
  79. </Setter.Value>
  80. </Setter>
  81. </Style>
  82. <Style x:Key="HelpTipStyle" TargetType="Label" />
  83. </UserControl.Resources>
  84. <cus:DialogContent Header="{Binding T_Title}">
  85. <cus:DialogContent.Content>
  86. <Grid Grid.Row="1">
  87. <Grid.ColumnDefinitions>
  88. <ColumnDefinition Width="238" />
  89. <ColumnDefinition Width="492" />
  90. </Grid.ColumnDefinitions>
  91. <Grid
  92. Grid.Column="0"
  93. Margin="16,0,10,0"
  94. VerticalAlignment="Top">
  95. <ContentControl prism:RegionManager.RegionName="{Binding HomePagePrinterDocumentRegionName}" Visibility="Visible" />
  96. </Grid>
  97. <Grid Grid.Column="1">
  98. <Grid>
  99. <Grid.RowDefinitions>
  100. <!-- 310 - 88 -->
  101. <RowDefinition Height="222" />
  102. <RowDefinition Height="216" />
  103. </Grid.RowDefinitions>
  104. <Grid Grid.Row="0" Margin="0,0,0,0">
  105. <Grid.RowDefinitions>
  106. <!-- 61 、27 -->
  107. <RowDefinition Height="72" />
  108. <RowDefinition Height="150" />
  109. <RowDefinition Height="0" />
  110. <RowDefinition Height="0" />
  111. </Grid.RowDefinitions>
  112. <StackPanel Grid.Row="0" Orientation="Vertical">
  113. <StackPanel Orientation="Horizontal">
  114. <TextBlock
  115. Height="22"
  116. FontFamily="Segoe UI"
  117. FontSize="14"
  118. Text="{Binding T_Printer}" />
  119. <ComboBox
  120. Name="PrinterNameComboBox"
  121. Width="273"
  122. Height="32"
  123. Margin="16,0,16,0"
  124. ItemsSource="{Binding PrinterNameList}"
  125. SelectedIndex="{Binding PrinterSelectedIndex}">
  126. <i:Interaction.Triggers>
  127. <i:EventTrigger EventName="SelectionChanged">
  128. <i:InvokeCommandAction Command="{Binding SelectPrinterCommand}" CommandParameter="{Binding ElementName=PrinterNameComboBox}" />
  129. </i:EventTrigger>
  130. <i:EventTrigger EventName="LostFocus" />
  131. </i:Interaction.Triggers>
  132. </ComboBox>
  133. <Button
  134. Name="PageSettingsBtn"
  135. Width="116"
  136. Height="32"
  137. Command="{Binding SetPaperCommand}"
  138. Content="{Binding T_PageSettings}"
  139. Style="{StaticResource PageSettingsBtnStyle}" />
  140. </StackPanel>
  141. <StackPanel Margin="0,8,0,0" Orientation="Horizontal">
  142. <StackPanel Orientation="Horizontal">
  143. <TextBlock
  144. Height="22"
  145. FontFamily="Segoe UI"
  146. FontSize="14"
  147. Text="{Binding T_Copies}" />
  148. <cus:NumericUpDown
  149. Width="132"
  150. Height="32"
  151. Margin="16,0,0,0"
  152. Minimum="1"
  153. Text="{Binding CopiesNumber, Mode=TwoWay}" />
  154. </StackPanel>
  155. <CheckBox
  156. Name="GrayscaleChk"
  157. Margin="17,0,0,0"
  158. VerticalAlignment="Center"
  159. Command="{Binding SetGrayscaleCommand}"
  160. CommandParameter="{Binding ElementName=GrayscaleChk}">
  161. <TextBlock
  162. FontFamily="Segoe UI"
  163. FontSize="14"
  164. Foreground="#252629"
  165. Text="{Binding T_BlackAndWhite}" />
  166. </CheckBox>
  167. </StackPanel>
  168. </StackPanel>
  169. <StackPanel
  170. Grid.Row="1"
  171. Margin="0,18,0,0"
  172. Orientation="Vertical">
  173. <TextBlock
  174. FontFamily="Segoe UI"
  175. FontSize="12"
  176. Foreground="#616469"
  177. Text="{Binding T_PrintSettings}" />
  178. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  179. <StackPanel Orientation="Horizontal">
  180. <TextBlock
  181. Width="82"
  182. Height="22"
  183. FontFamily="Segoe UI"
  184. FontSize="14"
  185. Text="Page range" />
  186. <cus:WritableComboBox
  187. x:Name="PageRangeComboBox"
  188. Width="132"
  189. Height="32"
  190. Margin="16,0,0,0"
  191. Loaded="PageRangeComboBox_Loaded"
  192. MaxPageRange="{Binding MaxPageRange, Mode=TwoWay}"
  193. SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"
  194. Text="{Binding CustomRangeString, Mode=TwoWay}">
  195. <i:Interaction.Triggers>
  196. <i:EventTrigger EventName="SelectionChanged">
  197. <i:InvokeCommandAction Command="{Binding SetPageRangeSelectionIndexCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}" />
  198. </i:EventTrigger>
  199. <i:EventTrigger EventName="TextChanged">
  200. <i:InvokeCommandAction Command="{Binding PageTextChangedCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}" />
  201. </i:EventTrigger>
  202. <i:KeyTrigger Key="Return" FiredOn="KeyDown">
  203. <i:InvokeCommandAction Command="{Binding SetCustomPageRangeCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}" />
  204. </i:KeyTrigger>
  205. </i:Interaction.Triggers>
  206. </cus:WritableComboBox>
  207. </StackPanel>
  208. <StackPanel Margin="20,0,0,0" Orientation="Horizontal">
  209. <TextBlock
  210. Height="22"
  211. FontFamily="Segoe UI"
  212. FontSize="14"
  213. Text="{Binding T_Orientation}" />
  214. <ComboBox
  215. Name="PrintOrientationCmb"
  216. Width="145"
  217. Height="32"
  218. Margin="16,0,0,0"
  219. ItemsSource="{Binding PrintOrientationList}"
  220. SelectedIndex="{Binding PrintOrientationIndex}">
  221. <i:Interaction.Triggers>
  222. <i:EventTrigger EventName="SelectionChanged">
  223. <i:InvokeCommandAction Command="{Binding SetPrintOritationCommand}" CommandParameter="{Binding ElementName=PrintOrientationCmb}" />
  224. </i:EventTrigger>
  225. </i:Interaction.Triggers>
  226. </ComboBox>
  227. </StackPanel>
  228. </StackPanel>
  229. <StackPanel Margin="0,8,0,0" Orientation="Horizontal">
  230. <TextBlock
  231. Width="82"
  232. Height="22"
  233. FontFamily="Segoe UI"
  234. FontSize="14"
  235. Text="{Binding T_PrintContent}" />
  236. <ComboBox
  237. Name="PrintContentCbx"
  238. Width="377"
  239. Height="32"
  240. Margin="16,0,16,0"
  241. ItemsSource="{Binding PrintContentList}"
  242. SelectedIndex="{Binding PrintContentIndex}">
  243. <i:Interaction.Triggers>
  244. <i:EventTrigger EventName="SelectionChanged">
  245. <i:InvokeCommandAction Command="{Binding SetPrintContentCommand}" CommandParameter="{Binding ElementName=PrintContentCbx}" />
  246. </i:EventTrigger>
  247. </i:Interaction.Triggers>
  248. </ComboBox>
  249. </StackPanel>
  250. <StackPanel Margin="0,12,0,0" Orientation="Horizontal">
  251. <CheckBox
  252. x:Name="ReversePageCbx"
  253. VerticalAlignment="Center"
  254. Command="{Binding SetReversePageCommand}"
  255. CommandParameter="{Binding ElementName=ReversePageCbx}">
  256. <TextBlock
  257. FontFamily="Segoe UI"
  258. FontSize="14"
  259. Text="{Binding T_ReversePages}" />
  260. </CheckBox>
  261. <CheckBox
  262. x:Name="PrintBorderCbx"
  263. Margin="25,0,0,0"
  264. VerticalAlignment="Center"
  265. Command="{Binding SetPrintBorderCommand}"
  266. CommandParameter="{Binding ElementName=PrintBorderCbx}"
  267. Visibility="{Binding PrintPageBorderVisibility}">
  268. <TextBlock
  269. FontFamily="Segoe UI"
  270. FontSize="14"
  271. Text="Print page border" />
  272. </CheckBox>
  273. </StackPanel>
  274. </StackPanel>
  275. <!-- TODO: Visibility解锁多功能打印 -->
  276. <StackPanel
  277. Grid.Row="2"
  278. Grid.RowSpan="2"
  279. Margin="0,18,0,0"
  280. Orientation="Vertical"
  281. Visibility="Collapsed">
  282. <StackPanel Orientation="Horizontal">
  283. <TextBlock
  284. FontFamily="Segoe UI"
  285. FontSize="12"
  286. Foreground="#616469"
  287. Text="Page Sizing &amp; Handling" />
  288. <Label Margin="9,0,0,0" Padding="0,0,0,0">
  289. <Grid>
  290. <Ellipse
  291. Width="16"
  292. Height="16"
  293. Fill="white"
  294. Stroke="#CED0D4" />
  295. <Path
  296. HorizontalAlignment="Center"
  297. VerticalAlignment="Center"
  298. Data="M2.29102 6.36328H3.65039V6.02344C3.65039 5.4375 3.86719 5.13281 4.63477 4.6875C5.43164 4.21289 5.87695 3.58594 5.87695 2.69531V2.68359C5.87695 1.40039 4.80469 0.474609 3.19922 0.474609C1.45898 0.474609 0.503906 1.48242 0.462891 2.85352V2.86523L1.82812 2.85938L1.83984 2.85352C1.88086 2.13281 2.36719 1.66992 3.12305 1.66992C3.86133 1.66992 4.35352 2.12109 4.35352 2.73633V2.74805C4.35352 3.32227 4.10742 3.63867 3.38086 4.07812C2.57227 4.55273 2.23242 5.08008 2.28516 5.94727L2.29102 6.36328ZM3.03516 9.14648C3.63281 9.14648 4.00781 8.7832 4.00781 8.22656C4.00781 7.66406 3.63281 7.30078 3.03516 7.30078C2.44922 7.30078 2.0625 7.66406 2.0625 8.22656C2.0625 8.7832 2.44922 9.14648 3.03516 9.14648Z"
  299. Fill="#94989C" />
  300. </Grid>
  301. <Label.ToolTip>
  302. <ToolTip Width="350" Background="{StaticResource color.sys.layout.dark.bg}">
  303. <StackPanel Margin="16,8">
  304. <TextBlock
  305. Foreground="{StaticResource color.sys.text.anti.norm}"
  306. Text="Page Sizing and Handling Information"
  307. TextWrapping="Wrap" />
  308. <StackPanel Orientation="Vertical">
  309. <Grid>
  310. <Grid.ColumnDefinitions>
  311. <ColumnDefinition Width="auto" />
  312. <ColumnDefinition />
  313. </Grid.ColumnDefinitions>
  314. <TextBlock
  315. FontWeight="Bold"
  316. Foreground="{StaticResource color.sys.text.anti.norm}"
  317. Text=" · " />
  318. <TextBlock
  319. Grid.Column="1"
  320. Foreground="{StaticResource color.sys.text.anti.norm}"
  321. Text="Size prints each PDF page on a single sheet of paper. "
  322. TextWrapping="Wrap" />
  323. </Grid>
  324. <Grid>
  325. <Grid.ColumnDefinitions>
  326. <ColumnDefinition Width="auto" />
  327. <ColumnDefinition />
  328. </Grid.ColumnDefinitions>
  329. <TextBlock
  330. FontWeight="Bold"
  331. Foreground="{StaticResource color.sys.text.anti.norm}"
  332. Text=" · " />
  333. <TextBlock
  334. Grid.Column="1"
  335. Foreground="{StaticResource color.sys.text.anti.norm}"
  336. Text="Poster prints a PDF page across multiple sheets to form a mosaic. "
  337. TextWrapping="Wrap" />
  338. </Grid>
  339. <Grid>
  340. <Grid.ColumnDefinitions>
  341. <ColumnDefinition Width="auto" />
  342. <ColumnDefinition />
  343. </Grid.ColumnDefinitions>
  344. <TextBlock
  345. FontWeight="Bold"
  346. Foreground="{StaticResource color.sys.text.anti.norm}"
  347. Text=" · " />
  348. <TextBlock
  349. Grid.Column="1"
  350. Foreground="{StaticResource color.sys.text.anti.norm}"
  351. Text="Multiple prints 2 or more PDF pages per sheet."
  352. TextWrapping="Wrap" />
  353. </Grid>
  354. <Grid>
  355. <Grid.ColumnDefinitions>
  356. <ColumnDefinition Width="auto" />
  357. <ColumnDefinition />
  358. </Grid.ColumnDefinitions>
  359. <TextBlock
  360. FontWeight="Bold"
  361. Foreground="{StaticResource color.sys.text.anti.norm}"
  362. Text=" · " />
  363. <TextBlock
  364. Grid.Column="1"
  365. Foreground="{StaticResource color.sys.text.anti.norm}"
  366. Text="Booklet prints brochures and other publications that will be folded and stapled or bound together."
  367. TextWrapping="Wrap" />
  368. </Grid>
  369. </StackPanel>
  370. </StackPanel>
  371. </ToolTip>
  372. </Label.ToolTip>
  373. </Label>
  374. </StackPanel>
  375. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  376. <RadioButton
  377. x:Name="ModSizeRdo"
  378. Width="111"
  379. Height="32"
  380. Background="WhiteSmoke"
  381. Command="{Binding ChangePrintModCommand}"
  382. CommandParameter="{Binding ElementName=ModSizeRdo}"
  383. Content="Size"
  384. IsChecked="True"
  385. Style="{StaticResource PrintModRdoStyle}" />
  386. <RadioButton
  387. Name="ModPosterRdo"
  388. Width="111"
  389. Height="32"
  390. Margin="8,0,8,0"
  391. Background="WhiteSmoke"
  392. Command="{Binding ChangePrintModCommand}"
  393. CommandParameter="{Binding ElementName=ModPosterRdo}"
  394. Content="Poster"
  395. Style="{StaticResource PrintModRdoStyle}" />
  396. <RadioButton
  397. Name="ModMultipleRdo"
  398. Width="111"
  399. Height="32"
  400. Margin="0,0,8,0"
  401. Background="WhiteSmoke"
  402. Command="{Binding ChangePrintModCommand}"
  403. CommandParameter="{Binding ElementName=ModMultipleRdo}"
  404. Content="Multiple"
  405. Style="{StaticResource PrintModRdoStyle}" />
  406. <RadioButton
  407. Name="ModBookletRdo"
  408. Width="111"
  409. Height="32"
  410. Margin="0,0,16,0"
  411. Background="WhiteSmoke"
  412. Command="{Binding ChangePrintModCommand}"
  413. CommandParameter="{Binding ElementName=ModBookletRdo}"
  414. Content="Booklet"
  415. Style="{StaticResource PrintModRdoStyle}" />
  416. </StackPanel>
  417. </StackPanel>
  418. </Grid>
  419. <Grid
  420. Grid.Row="1"
  421. Margin="0,0,8,0"
  422. VerticalAlignment="Top">
  423. <Grid.ColumnDefinitions>
  424. <ColumnDefinition Width="29*" />
  425. <ColumnDefinition Width="213*" />
  426. </Grid.ColumnDefinitions>
  427. <ContentControl
  428. Grid.ColumnSpan="2"
  429. prism:RegionManager.RegionName="{Binding HomePagePrinterModRegionName}"
  430. Visibility="Visible" />
  431. </Grid>
  432. </Grid>
  433. </Grid>
  434. </Grid>
  435. </cus:DialogContent.Content>
  436. <cus:DialogContent.BottmBar>
  437. <Grid Grid.Row="2">
  438. <StackPanel
  439. Margin="15,0,0,16"
  440. HorizontalAlignment="Right"
  441. Orientation="Horizontal">
  442. <Button
  443. Width="80"
  444. Height="32"
  445. Margin="0,0,16,0"
  446. Command="{Binding ConfirmPrintCommand}"
  447. Content="Print"
  448. Style="{StaticResource Btn.cta}" />
  449. <Button
  450. Width="80"
  451. Height="32"
  452. Margin="0,0,16,0"
  453. Command="{Binding CancelCommand}"
  454. Content="Cancel"
  455. Style="{StaticResource PageSettingsBtnStyle}" />
  456. </StackPanel>
  457. </Grid>
  458. </cus:DialogContent.BottmBar>
  459. </cus:DialogContent>
  460. </UserControl>