HomePagePrinterDialog.xaml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <UserControl x:Class="PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePagePrinter.HomePagePrinterDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/" xmlns:cus="clr-namespace:PDF_Master.CustomControl" xmlns:homepageprinter="clr-namespace:PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:DataContext="{d:DesignInstance Type=homepageprinter:HomePagePrinterDialogViewModel}"
  5. prism:ViewModelLocator.AutoWireViewModel="True"
  6. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}">
  7. <UserControl.Resources>
  8. <Style x:Key="PageSettingsBtnStyle" TargetType="Button">
  9. <Setter Property="Template">
  10. <Setter.Value>
  11. <ControlTemplate TargetType="{x:Type Button}">
  12. <Grid>
  13. <Border x:Name="PageSettingsBtnBorder" BorderBrush="{StaticResource color.btn.sec.border-color}" Background="Transparent" BorderThickness="1" CornerRadius="4">
  14. <Grid>
  15. <TextBlock Text="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="14" FontFamily="Segoe UI"></TextBlock>
  16. </Grid>
  17. </Border>
  18. </Grid>
  19. <ControlTemplate.Triggers>
  20. <Trigger Property="IsMouseOver" Value="True">
  21. <Setter Property="Background" TargetName="PageSettingsBtnBorder" Value="{StaticResource color.btn.sec.bg.hov}"></Setter>
  22. </Trigger>
  23. <Trigger Property="IsPressed" Value="True">
  24. <Setter Property="Background" TargetName="PageSettingsBtnBorder" Value="{StaticResource color.btn.sec.bg.act}"></Setter>
  25. </Trigger>
  26. </ControlTemplate.Triggers>
  27. </ControlTemplate>
  28. </Setter.Value>
  29. </Setter>
  30. </Style>
  31. <Style TargetType="RadioButton" x:Key="PrintModRdoStyle">
  32. <Setter Property="Template">
  33. <Setter.Value>
  34. <ControlTemplate TargetType="{x:Type RadioButton}">
  35. <Border x:Name="PrintModRdo" Background="{StaticResource color.btn.sec.bg.norm}"
  36. BorderBrush="{StaticResource color.btn.sec.border-color }"
  37. BorderThickness="1"
  38. CornerRadius="4"
  39. VerticalAlignment="Center">
  40. <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
  41. <TextBlock Text="{TemplateBinding Content}" FontSize="14" Foreground="{StaticResource color.btn.sec.text.def}" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
  42. </Grid>
  43. </Border>
  44. <ControlTemplate.Triggers>
  45. <Trigger Property="IsMouseOver" Value="True">
  46. <Setter Property="Background" TargetName="PrintModRdo" Value="{StaticResource color.btn.sec.bg.hov}"></Setter>
  47. </Trigger>
  48. <Trigger Property="IsChecked" Value="False">
  49. <Setter Property="Background" TargetName="PrintModRdo" Value="{StaticResource color.btn.sec.bg.norm}"></Setter>
  50. </Trigger>
  51. <Trigger Property="IsChecked" Value="True">
  52. <Setter Property="Background" TargetName="PrintModRdo" Value="{StaticResource color.btn.sec.bg.act}"></Setter>
  53. </Trigger>
  54. </ControlTemplate.Triggers>
  55. </ControlTemplate>
  56. </Setter.Value>
  57. </Setter>
  58. </Style>
  59. <Style x:Key="HelpTipStyle" TargetType="Label"></Style>
  60. </UserControl.Resources>
  61. <cus:DialogContent Header="{Binding T_Title}">
  62. <cus:DialogContent.Content>
  63. <Grid Grid.Row="1">
  64. <Grid.ColumnDefinitions>
  65. <ColumnDefinition Width="238"></ColumnDefinition>
  66. <ColumnDefinition Width="492"></ColumnDefinition>
  67. </Grid.ColumnDefinitions>
  68. <Grid Grid.Column="0" Margin="16,0,10,0" VerticalAlignment="Top">
  69. <ContentControl prism:RegionManager.RegionName="{Binding HomePagePrinterDocumentRegionName}" Visibility="Visible"/>
  70. </Grid>
  71. <Grid Grid.Column="1">
  72. <Grid>
  73. <Grid.RowDefinitions>
  74. <!--310 - 88-->
  75. <RowDefinition Height="222"></RowDefinition>
  76. <RowDefinition Height="216"></RowDefinition>
  77. </Grid.RowDefinitions>
  78. <Grid Grid.Row="0" Margin="0,0,0,0" >
  79. <Grid.RowDefinitions>
  80. <!--61 、27 -->
  81. <RowDefinition Height="72"></RowDefinition>
  82. <RowDefinition Height="150"></RowDefinition>
  83. <RowDefinition Height="0"></RowDefinition>
  84. <RowDefinition Height="0"/>
  85. </Grid.RowDefinitions>
  86. <StackPanel Grid.Row="0" Orientation="Vertical">
  87. <StackPanel Orientation="Horizontal">
  88. <TextBlock Text="{Binding T_Printer}" FontFamily="Segoe UI" FontSize="14" Height="22" ></TextBlock>
  89. <ComboBox Name="PrinterNameComboBox" Width="273" Height="32" Margin="16,0,16,0" ItemsSource="{Binding PrinterNameList}" SelectedIndex="{Binding PrinterSelectedIndex}">
  90. <i:Interaction.Triggers>
  91. <i:EventTrigger EventName="SelectionChanged">
  92. <i:InvokeCommandAction Command="{Binding SelectPrinterCommand}" CommandParameter="{Binding ElementName=PrinterNameComboBox}"/>
  93. </i:EventTrigger>
  94. <i:EventTrigger EventName="LostFocus">
  95. </i:EventTrigger>
  96. </i:Interaction.Triggers>
  97. </ComboBox>
  98. <Button Name="PageSettingsBtn" Style="{StaticResource PageSettingsBtnStyle}" Content="{Binding T_PageSettings}" Height="32" Width="116" Command="{Binding SetPaperCommand}" />
  99. </StackPanel>
  100. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  101. <StackPanel Orientation="Horizontal">
  102. <TextBlock Height="22" Text="{Binding T_Copies}" FontFamily="Segoe UI" FontSize="14"></TextBlock>
  103. <cus:NumericUpDown Height="32" Width="132" Margin="16,0,0,0" Minimum="1" Text="{Binding CopiesNumber}"></cus:NumericUpDown>
  104. </StackPanel>
  105. <CheckBox Name="GrayscaleChk" VerticalAlignment="Center" Margin="17,0,0,0" Command="{Binding SetGrayscaleCommand}" CommandParameter="{Binding ElementName=GrayscaleChk}">
  106. <TextBlock Text="{Binding T_BlackAndWhite}" Foreground="#252629" FontFamily="Segoe UI" FontSize="14"/>
  107. </CheckBox>
  108. </StackPanel>
  109. </StackPanel>
  110. <StackPanel Grid.Row="1" Orientation="Vertical" Margin="0,18,0,0">
  111. <TextBlock Text="{Binding T_PrintSettings}" FontFamily="Segoe UI" FontSize="12" Foreground="#616469"/>
  112. <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
  113. <StackPanel Orientation="Horizontal">
  114. <TextBlock Text="Page range:" FontFamily="Segoe UI" FontSize="14" Height="22" Width="80"></TextBlock>
  115. <cus:WritableComboBox x:Name="PageRangeComboBox" Loaded="PageRangeComboBox_Loaded" Text="{Binding CustomRangeString, Mode=TwoWay}" Width="132" Height="32" Margin="16,0,0,0" MaxPageRange="{Binding MaxPageRange, Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}">
  116. <i:Interaction.Triggers>
  117. <i:EventTrigger EventName="SelectionChanged">
  118. <i:InvokeCommandAction Command="{Binding SetPageRangeSelectionIndexCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}"></i:InvokeCommandAction>
  119. </i:EventTrigger>
  120. <i:KeyTrigger FiredOn="KeyDown" Key="Return">
  121. <i:InvokeCommandAction Command="{Binding SetCustomPageRangeCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}"></i:InvokeCommandAction>
  122. </i:KeyTrigger>
  123. </i:Interaction.Triggers>
  124. </cus:WritableComboBox>
  125. </StackPanel>
  126. <StackPanel Orientation="Horizontal" Margin="20,0,0,0">
  127. <TextBlock Text="{Binding T_Orientation}" FontFamily="Segoe UI" FontSize="14" Height="22"></TextBlock>
  128. <ComboBox Name="PrintOrientationCmb" Width="145" Height="32" Margin="16,0,0,0" ItemsSource="{Binding PrintOrientationList}" SelectedIndex="{Binding PrintOrientationIndex}">
  129. <i:Interaction.Triggers>
  130. <i:EventTrigger EventName="SelectionChanged">
  131. <i:InvokeCommandAction Command="{Binding SetPrintOritationCommand}" CommandParameter="{Binding ElementName=PrintOrientationCmb}"></i:InvokeCommandAction>
  132. </i:EventTrigger>
  133. </i:Interaction.Triggers>
  134. </ComboBox>
  135. </StackPanel>
  136. </StackPanel>
  137. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  138. <TextBlock Text="{Binding T_PrintContent}" FontFamily="Segoe UI" FontSize="14" Height="22" Width="80"></TextBlock>
  139. <ComboBox Name="PrintContentCbx" Width="377" Height="32" Margin="16,0,16,0" ItemsSource="{Binding PrintContentList}" SelectedIndex="{Binding PrintContentIndex}" >
  140. <i:Interaction.Triggers>
  141. <i:EventTrigger EventName="SelectionChanged">
  142. <i:InvokeCommandAction Command="{Binding SetPrintContentCommand}" CommandParameter="{Binding ElementName=PrintContentCbx}"></i:InvokeCommandAction>
  143. </i:EventTrigger>
  144. </i:Interaction.Triggers>
  145. </ComboBox>
  146. </StackPanel>
  147. <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
  148. <CheckBox x:Name="ReversePageCbx" VerticalAlignment="Center" Command="{Binding SetReversePageCommand}" CommandParameter="{Binding ElementName=ReversePageCbx}">
  149. <TextBlock Text="{Binding T_ReversePages}" FontFamily="Segoe UI" FontSize="14"/>
  150. </CheckBox>
  151. <CheckBox x:Name="PrintBorderCbx" VerticalAlignment="Center" Margin="25,0,0,0" Command="{Binding SetPrintBorderCommand}" CommandParameter="{Binding ElementName=PrintBorderCbx}" Visibility="{Binding PrintPageBorderVisibility}">
  152. <TextBlock Text="Print page border" FontFamily="Segoe UI" FontSize="14"/>
  153. </CheckBox>
  154. </StackPanel>
  155. </StackPanel>
  156. <!--TODO: Visibility解锁多功能打印-->
  157. <StackPanel Grid.Row="2" Orientation="Vertical" Margin="0,18,0,0" Visibility="Collapsed" Grid.RowSpan="2">
  158. <StackPanel Orientation="Horizontal">
  159. <TextBlock Text="Page Sizing &amp; Handling" FontFamily="Segoe UI" FontSize="12" Foreground="#616469"/>
  160. <Label Padding="0,0,0,0" Margin="9,0,0,0">
  161. <Grid>
  162. <Ellipse Width="16" Height="16" Fill="white" Stroke="#CED0D4"></Ellipse>
  163. <Path 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" Fill="#94989C" HorizontalAlignment="Center" VerticalAlignment="Center"></Path>
  164. </Grid>
  165. <Label.ToolTip>
  166. <ToolTip Background="{StaticResource color.sys.layout.dark.bg}" Width="350">
  167. <StackPanel Margin="16,8">
  168. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text = "Page Sizing and Handling Information" TextWrapping="Wrap"/>
  169. <StackPanel Orientation="Vertical">
  170. <Grid>
  171. <Grid.ColumnDefinitions>
  172. <ColumnDefinition Width="auto"></ColumnDefinition>
  173. <ColumnDefinition></ColumnDefinition>
  174. </Grid.ColumnDefinitions>
  175. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text= " · " FontWeight="Bold"/>
  176. <TextBlock Grid.Column="1" Foreground="{StaticResource color.sys.text.anti.norm}" Text= "Size prints each PDF page on a single sheet of paper. " TextWrapping="Wrap"/>
  177. </Grid>
  178. <Grid>
  179. <Grid.ColumnDefinitions>
  180. <ColumnDefinition Width="auto"></ColumnDefinition>
  181. <ColumnDefinition></ColumnDefinition>
  182. </Grid.ColumnDefinitions>
  183. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text= " · " FontWeight="Bold"/>
  184. <TextBlock Grid.Column="1" Foreground="{StaticResource color.sys.text.anti.norm}" Text= "Poster prints a PDF page across multiple sheets to form a mosaic. " TextWrapping="Wrap"/>
  185. </Grid>
  186. <Grid>
  187. <Grid.ColumnDefinitions>
  188. <ColumnDefinition Width="auto"></ColumnDefinition>
  189. <ColumnDefinition></ColumnDefinition>
  190. </Grid.ColumnDefinitions>
  191. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text= " · " FontWeight="Bold"/>
  192. <TextBlock Grid.Column="1" Foreground="{StaticResource color.sys.text.anti.norm}" Text= "Multiple prints 2 or more PDF pages per sheet." TextWrapping="Wrap"/>
  193. </Grid>
  194. <Grid>
  195. <Grid.ColumnDefinitions>
  196. <ColumnDefinition Width="auto"></ColumnDefinition>
  197. <ColumnDefinition></ColumnDefinition>
  198. </Grid.ColumnDefinitions>
  199. <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text= " · " FontWeight="Bold"/>
  200. <TextBlock Grid.Column="1" Foreground="{StaticResource color.sys.text.anti.norm}" Text= "Booklet prints brochures and other publications that will be folded and stapled or bound together." TextWrapping="Wrap"/>
  201. </Grid>
  202. </StackPanel>
  203. </StackPanel>
  204. </ToolTip>
  205. </Label.ToolTip>
  206. </Label>
  207. </StackPanel>
  208. <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
  209. <RadioButton Style="{StaticResource PrintModRdoStyle}" x:Name="ModSizeRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModSizeRdo}" Content="Size" Background="WhiteSmoke" Width="111" Height="32" IsChecked="True">
  210. </RadioButton>
  211. <RadioButton Style="{StaticResource PrintModRdoStyle}" Name="ModPosterRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModPosterRdo}" Content="Poster" Background="WhiteSmoke" Width="111" Height="32" Margin="8,0,8,0">
  212. </RadioButton>
  213. <RadioButton Style="{StaticResource PrintModRdoStyle}" Name="ModMultipleRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModMultipleRdo}" Content="Multiple" Background="WhiteSmoke" Width="111" Height="32" Margin="0,0,8,0">
  214. </RadioButton>
  215. <RadioButton Style="{StaticResource PrintModRdoStyle}" Name="ModBookletRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModBookletRdo}" Content="Booklet" Background="WhiteSmoke" Width="111" Height="32" Margin="0,0,16,0">
  216. </RadioButton>
  217. </StackPanel>
  218. </StackPanel>
  219. </Grid>
  220. <Grid Grid.Row="1" Margin="0,0,8,0" VerticalAlignment="Top">
  221. <Grid.ColumnDefinitions>
  222. <ColumnDefinition Width="29*"/>
  223. <ColumnDefinition Width="213*"/>
  224. </Grid.ColumnDefinitions>
  225. <ContentControl prism:RegionManager.RegionName="{Binding HomePagePrinterModRegionName}" Visibility="Visible" Grid.ColumnSpan="2"/>
  226. </Grid>
  227. </Grid>
  228. </Grid>
  229. </Grid>
  230. </cus:DialogContent.Content>
  231. <cus:DialogContent.BottmBar>
  232. <Grid Grid.Row="2">
  233. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="15,0,0,16">
  234. <Button Width="80" Height="32" Style="{StaticResource Btn.cta}" Content="Print" Margin="0,0,16,0" Command="{Binding ConfirmPrintCommand}"></Button>
  235. <Button Width="80" Height="32" Style="{StaticResource PageSettingsBtnStyle}" Content="Cancel" Margin="0,0,16,0" Command="{Binding CancelCommand}"></Button>
  236. </StackPanel>
  237. </Grid>
  238. </cus:DialogContent.BottmBar>
  239. </cus:DialogContent>
  240. </UserControl>