PrinterDialog.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <Window x:Class="ComPDFKit.Controls.PDFControl.PrinterDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:ComPDFKit.Controls.PDFControl"
  7. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  8. mc:Ignorable="d"
  9. Title="PrinterDialog" Height="490" Width="835 "
  10. ResizeMode="NoResize"
  11. Loaded="PrinterDialog_Loaded">
  12. <Window.Resources>
  13. <ResourceDictionary>
  14. <common:CommonResourceConverter x:Key="CommonResourceConverter"></common:CommonResourceConverter>
  15. <Style x:Key="TitleTextBlockStyle" TargetType="{x:Type TextBlock}">
  16. <Setter Property="FontSize" Value="12"></Setter>
  17. <Setter Property="FontWeight" Value="SemiBold"></Setter>
  18. <Setter Property="Margin" Value="0,8,0,8"></Setter>
  19. <Setter Property="FontFamily" Value="Segoe UI"></Setter>
  20. </Style>
  21. <common:SecurityResourceConverter x:Key="SecurityResourceConverter"/>
  22. <common:StringToVisibilityConverter x:Key="StringToVisibilityConverter"></common:StringToVisibilityConverter>
  23. <common:BoolToVisibleConverter x:Key="BoolToVisibleConverter"></common:BoolToVisibleConverter>
  24. <ResourceDictionary.MergedDictionaries>
  25. <ResourceDictionary Source="../Asset/Styles/RadioButtonStyle.xaml"></ResourceDictionary>
  26. <ResourceDictionary Source="../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
  27. <ResourceDictionary Source="../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  28. </ResourceDictionary.MergedDictionaries>
  29. </ResourceDictionary>
  30. </Window.Resources>
  31. <Grid Margin="0,30,0,0">
  32. <Grid.RowDefinitions>
  33. <RowDefinition></RowDefinition>
  34. <RowDefinition Height="60"></RowDefinition>
  35. </Grid.RowDefinitions>
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="260"></ColumnDefinition>
  38. <ColumnDefinition></ColumnDefinition>
  39. <ColumnDefinition Width="300"></ColumnDefinition>
  40. </Grid.ColumnDefinitions>
  41. <local:PrintPreviewControl x:Name="ctlPreview" Margin="10,0,10,0"></local:PrintPreviewControl>
  42. <StackPanel Orientation="Vertical" Grid.Column="1" Margin="16,0,8,0">
  43. <StackPanel Orientation="Vertical">
  44. <StackPanel Grid.Row="0" Orientation="Vertical">
  45. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Printer}" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,8"></TextBlock>
  46. <StackPanel Orientation="Horizontal">
  47. <ComboBox
  48. Style="{StaticResource ComboBoxStyle1}"
  49. Name="cmbPrinterName"
  50. SelectionChanged="cmbPrinterName_SelectionChanged"
  51. Width="200"
  52. HorizontalAlignment="Left"
  53. Height="24" >
  54. </ComboBox>
  55. </StackPanel>
  56. <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
  57. <CheckBox
  58. x:Name="chkGrayScale"
  59. VerticalAlignment="Center"
  60. Click="chkGrayScale_Click">
  61. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_GrayScale}"></TextBlock>
  62. </CheckBox>
  63. </StackPanel>
  64. </StackPanel>
  65. <StackPanel Margin="0,8,0,0" Grid.Row="1" Orientation="Vertical">
  66. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Settings}" Style="{StaticResource TitleTextBlockStyle}"></TextBlock>
  67. <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
  68. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Paper}"
  69. Width="64"
  70. Height="22"
  71. FontFamily="Segoe UI"
  72. FontSize="14"></TextBlock>
  73. <ComboBox
  74. x:Name="cmbPaper"
  75. SelectionChanged="cmbPaper_SelectionChanged"
  76. Style="{StaticResource ComboBoxStyle1}"
  77. Width="155"
  78. Height="24" ></ComboBox>
  79. </StackPanel>
  80. <StackPanel Orientation="Horizontal" Margin="0,0,0,8">
  81. <TextBlock
  82. Width="64"
  83. Height="22"
  84. FontFamily="Segoe UI"
  85. FontSize="14" Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Oritation}"></TextBlock>
  86. <ComboBox
  87. x:Name="cmbOritation"
  88. Style="{StaticResource ComboBoxStyle1}"
  89. SelectionChanged="cmbOritation_SelectionChanged"
  90. Width="155"
  91. Height="24"
  92. Loaded="cmbOritation_Loaded" >
  93. <ComboBoxItem Tag="Portrait">
  94. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Portrait}"></TextBlock>
  95. </ComboBoxItem>
  96. <ComboBoxItem Tag="Landscape">
  97. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Landscape}"></TextBlock>
  98. </ComboBoxItem>
  99. <ComboBoxItem Tag="Auto">
  100. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Auto}"></TextBlock>
  101. </ComboBoxItem>
  102. </ComboBox>
  103. </StackPanel>
  104. </StackPanel>
  105. </StackPanel>
  106. <StackPanel Orientation="Vertical">
  107. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_PageRange}" Style="{StaticResource TitleTextBlockStyle}" Margin="0,8,0,8"></TextBlock>
  108. <RadioButton Margin="-8,0,0,8" GroupName="Page Range" x:Name="rdoAllPages" Tag="All" IsChecked="True" Click="rdoPageRange_Click">
  109. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_AllPages}"></TextBlock>
  110. </RadioButton>
  111. <RadioButton Margin="-8,0,0,8" GroupName="Page Range" x:Name="rdoOddPages" Tag="Odd" Click="rdoPageRange_Click">
  112. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_OnlyOdd}"></TextBlock>
  113. </RadioButton>
  114. <RadioButton Margin="-8,0,0,8" GroupName="Page Range" x:Name="rdoEvenPages" Tag="Even" Click="rdoPageRange_Click">
  115. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_OnlyEven}"></TextBlock>
  116. </RadioButton>
  117. <StackPanel Orientation="Horizontal">
  118. <RadioButton Margin="-8,0,8,8" GroupName="Page Range" x:Name="rdoCustomPages" Tag="Custom" Click="rdoPageRange_Click">
  119. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_CustomPages}"></TextBlock>
  120. </RadioButton>
  121. <TextBox Width="120" Height="24" Text="{Binding PageRangeText, UpdateSourceTrigger=PropertyChanged}"></TextBox>
  122. </StackPanel>
  123. <CheckBox x:Name="chkReversePage" VerticalAlignment="Center" Click="chkReversePage_Click">
  124. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_ReversePage}"></TextBlock>
  125. </CheckBox>
  126. </StackPanel>
  127. </StackPanel>
  128. <Rectangle Width="1" Fill="#1A000000" Grid.Column="2" HorizontalAlignment="Left"></Rectangle>
  129. <StackPanel Orientation="Vertical" Grid.Column="2" Width="280" Margin="8,0,8,0">
  130. <StackPanel Orientation="Vertical" HorizontalAlignment="Left" Margin="0,0,0,0">
  131. <TextBlock
  132. Style="{StaticResource TitleTextBlockStyle}"
  133. Margin="0,0,0,8"
  134. Width="80"
  135. Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Content}" HorizontalAlignment="Left"></TextBlock>
  136. <ComboBox
  137. x:Name="cmbContent"
  138. Style="{StaticResource ComboBoxStyle1}"
  139. SelectionChanged="cmbContent_SelectionChanged"
  140. HorizontalAlignment="Left"
  141. Width="220"
  142. Height="24"
  143. Loaded="cmbContent_Loaded">
  144. <ComboBoxItem Tag="Document">
  145. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_OnlyD}"></TextBlock>
  146. </ComboBoxItem>
  147. <ComboBoxItem Tag="Document and Markups">
  148. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_DaM}"></TextBlock>
  149. </ComboBoxItem>
  150. <ComboBoxItem Tag="Document and Stamps">
  151. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_DaS}"></TextBlock>
  152. </ComboBoxItem>
  153. </ComboBox>
  154. </StackPanel>
  155. <StackPanel Orientation="Vertical" Margin="0,8,0,8">
  156. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Size}" Style="{StaticResource TitleTextBlockStyle}"></TextBlock>
  157. <Grid VerticalAlignment="Top">
  158. <Grid.ColumnDefinitions>
  159. <ColumnDefinition Width="31*"/>
  160. <ColumnDefinition Width="36*"/>
  161. </Grid.ColumnDefinitions>
  162. <Grid.RowDefinitions>
  163. <RowDefinition></RowDefinition>
  164. </Grid.RowDefinitions>
  165. <Grid Grid.ColumnSpan="2">
  166. <Grid.ColumnDefinitions>
  167. <ColumnDefinition Width="49*"/>
  168. <ColumnDefinition Width="188*"/>
  169. </Grid.ColumnDefinitions>
  170. <Grid.RowDefinitions>
  171. <RowDefinition Height="28"></RowDefinition>
  172. <RowDefinition Height="28"></RowDefinition>
  173. <RowDefinition Height="28"></RowDefinition>
  174. </Grid.RowDefinitions>
  175. <RadioButton GroupName="SizeMode" VerticalAlignment="Center" Grid.ColumnSpan="2" IsChecked="True" Tag="AutoAdapt" Click="SizeMode_Click">
  176. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_AutoAdapt}"></TextBlock>
  177. </RadioButton>
  178. <RadioButton GroupName="SizeMode" Grid.Row="1" VerticalAlignment="Center" Grid.ColumnSpan="2" Tag="ActualSize" Click="SizeMode_Click">
  179. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_ActualSize}"></TextBlock>
  180. </RadioButton>
  181. <StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" Grid.ColumnSpan="2">
  182. <RadioButton GroupName="SizeMode" VerticalAlignment="Center" Tag="CustomScale" Click="SizeMode_Click">
  183. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_CustomScale}"></TextBlock>
  184. </RadioButton>
  185. <common:NumericUpDownControl x:Name="nmrcScale" Minimum="1" Maximum="1000" Height="24" Margin="16,0,0,0" Text="{Binding SizeScale, Mode=TwoWay}"></common:NumericUpDownControl>
  186. </StackPanel>
  187. </Grid>
  188. </Grid>
  189. </StackPanel>
  190. <StackPanel Grid.Row="3" VerticalAlignment="Top" >
  191. <CheckBox Name="chkDuplex" Margin="0,8,0,8" Tag="" Click="chkDuplex_Click">
  192. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_Duplex}"></TextBlock>
  193. </CheckBox>
  194. <RadioButton GroupName="Flip" x:Name="rdoLongEdge" Tag="LongEdge" IsChecked="True" IsEnabled="{Binding IsChecked, ElementName=chkDuplex, Converter={StaticResource BoolToVisibleConverter}}" Margin="0,0,0,8" Click="rdoDuplex_Click" >
  195. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_LongEdge}"></TextBlock>
  196. </RadioButton>
  197. <RadioButton GroupName="Flip" x:Name="rdoShortEdge" Tag="ShortEdge" Click="rdoDuplex_Click" IsEnabled="{Binding IsChecked, ElementName=chkDuplex, Converter={StaticResource BoolToVisibleConverter}}">
  198. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Printer_ShortEdge}"></TextBlock>
  199. </RadioButton>
  200. </StackPanel>
  201. </StackPanel>
  202. <StackPanel Grid.Column="2" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
  203. <Button x:Name="btnConfirm" Height="36" Width="108" Click="btnConfirm_Click">
  204. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Button_OK}"></TextBlock>
  205. </Button>
  206. <Button x:Name="btnCancel" Height="36" Width="108" Margin="10" Click="btnCancel_Click">
  207. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Button_Cancel}"></TextBlock>
  208. </Button>
  209. </StackPanel>
  210. </Grid>
  211. </Window>