HomePagePrinterDialog.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <UserControl x:Class="PDF_Office.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_Office.CustomControl" xmlns:homepageprinter="clr-namespace:PDF_Office.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. <UserControl.Resources>
  7. <ResourceDictionary >
  8. <ResourceDictionary.MergedDictionaries>
  9. <ResourceDictionary Source="../../../../Styles/RadioButtonStyle.xaml"></ResourceDictionary>
  10. </ResourceDictionary.MergedDictionaries>
  11. </ResourceDictionary>
  12. </UserControl.Resources>
  13. <prism:Dialog.WindowStyle>
  14. <Style TargetType="{x:Type Window}">
  15. <Setter Property="Title" Value="{Binding Title}" />
  16. <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterScreen" />
  17. <Setter Property="WindowStyle" Value="None" />
  18. <Setter Property="MaxHeight" Value="620"></Setter>
  19. <Setter Property="MaxWidth" Value="740"></Setter>
  20. <Setter Property="MinHeight" Value="620"></Setter>
  21. <Setter Property="MinWidth" Value="740"></Setter>
  22. </Style>
  23. </prism:Dialog.WindowStyle>
  24. <Grid>
  25. <Grid.RowDefinitions>
  26. <RowDefinition Height="50"></RowDefinition>
  27. <RowDefinition Height="506"></RowDefinition>
  28. <RowDefinition Height="64"></RowDefinition>
  29. </Grid.RowDefinitions>
  30. <Grid Name="Title" Background="Transparent">
  31. <TextBlock Text="Print" FontSize="16" FontWeight="ExtraBlack" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="16,13,0,13" Height="24" />
  32. </Grid>
  33. <Grid Grid.Row="1">
  34. <Grid.ColumnDefinitions>
  35. <ColumnDefinition Width="238"></ColumnDefinition>
  36. <ColumnDefinition Width="492"></ColumnDefinition>
  37. </Grid.ColumnDefinitions>
  38. <Grid Grid.Column="0" Margin="16,0,10,0" VerticalAlignment="Top">
  39. <ContentControl prism:RegionManager.RegionName="{Binding HomePagePrinterDocumentRegionName}" Visibility="Visible"/>
  40. </Grid>
  41. <Grid Grid.Column="1">
  42. <Grid>
  43. <Grid.RowDefinitions>
  44. <RowDefinition Height="310"></RowDefinition>
  45. <RowDefinition Height="216"></RowDefinition>
  46. </Grid.RowDefinitions>
  47. <Grid Grid.Row="0" Margin="0,0,0,0" >
  48. <Grid.RowDefinitions>
  49. <RowDefinition Height="72"></RowDefinition>
  50. <RowDefinition Height="150"></RowDefinition>
  51. <RowDefinition Height="*"></RowDefinition>
  52. </Grid.RowDefinitions>
  53. <StackPanel Grid.Row="0" Orientation="Vertical">
  54. <StackPanel Orientation="Horizontal">
  55. <TextBlock Text="Printer:" FontFamily="Segoe UI" FontSize="14" Height="22" ></TextBlock>
  56. <ComboBox Name="PrinterNameComboBox" Width="273" Height="32" Margin="16,0,16,0" ItemsSource="{Binding PrinterNameList}" SelectedIndex="{Binding PrinterSelectedIndex}">
  57. <i:Interaction.Triggers>
  58. <i:EventTrigger EventName="SelectionChanged">
  59. <i:InvokeCommandAction Command="{Binding SelectPrinterCommand}" CommandParameter="{Binding ElementName=PrinterNameComboBox}"/>
  60. </i:EventTrigger>
  61. <i:EventTrigger EventName="LostFocus">
  62. </i:EventTrigger>
  63. </i:Interaction.Triggers>
  64. </ComboBox>
  65. <Button Content="Page Settings" Height="32" Width="116" Command="{Binding SetPaperCommand}"/>
  66. </StackPanel>
  67. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  68. <StackPanel Orientation="Horizontal">
  69. <TextBlock Height="22" Text="Copies:" FontFamily="Segoe UI" FontSize="14"></TextBlock>
  70. <cus:NumericUpDown Height="32" Width="132" Margin="16,0,0,0"></cus:NumericUpDown>
  71. </StackPanel>
  72. <CheckBox Name="GrayscaleChk" VerticalAlignment="Center" Margin="17,0,0,0" Command="{Binding SetGrayscaleCommand}" CommandParameter="{Binding ElementName=GrayscaleChk}">
  73. <TextBlock Text="Black and White" Foreground="#252629" FontFamily="Segoe UI" FontSize="14"/>
  74. </CheckBox>
  75. </StackPanel>
  76. </StackPanel>
  77. <StackPanel Grid.Row="1" Orientation="Vertical" Margin="0,18,0,0">
  78. <TextBlock Text="Print Settings" FontFamily="Segoe UI" FontSize="12" Foreground="#616469"/>
  79. <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
  80. <StackPanel Orientation="Horizontal">
  81. <TextBlock Text="Page range:" FontFamily="Segoe UI" FontSize="14" Height="22" Width="80"></TextBlock>
  82. <cus:WritableComboBox x:Name="PageRangeComboBox" Loaded="PageRangeComboBox_Loaded" Width="132" Height="32" Margin="16,0,0,0">
  83. <i:Interaction.Triggers>
  84. <i:EventTrigger EventName="SelectionChanged">
  85. <i:InvokeCommandAction Command="{Binding SetPageRangeSelectionIndexCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}"></i:InvokeCommandAction>
  86. </i:EventTrigger>
  87. <i:KeyTrigger FiredOn="KeyDown" Key="Return">
  88. <i:InvokeCommandAction Command="{Binding SetCustomPageRangeCommand}" CommandParameter="{Binding ElementName=PageRangeComboBox}"></i:InvokeCommandAction>
  89. </i:KeyTrigger>
  90. </i:Interaction.Triggers>
  91. </cus:WritableComboBox>
  92. </StackPanel>
  93. <StackPanel Orientation="Horizontal" Margin="20,0,0,0">
  94. <TextBlock Text="Direction:" FontFamily="Segoe UI" FontSize="14" Height="22"></TextBlock>
  95. <ComboBox Name="PrintOrientationCmb" Width="145" Height="32" Margin="16,0,0,0" ItemsSource="{Binding PrintOrientationList}" SelectedIndex="{Binding PrintOrientationIndex}">
  96. <i:Interaction.Triggers>
  97. <i:EventTrigger EventName="SelectionChanged">
  98. <i:InvokeCommandAction Command="{Binding SetPrintOritationCommand}" CommandParameter="{Binding ElementName=PrintOrientationCmb}"></i:InvokeCommandAction>
  99. </i:EventTrigger>
  100. </i:Interaction.Triggers>
  101. </ComboBox>
  102. </StackPanel>
  103. </StackPanel>
  104. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  105. <TextBlock Text="Contents:" FontFamily="Segoe UI" FontSize="14" Height="22" Width="80"></TextBlock>
  106. <ComboBox Name="PrintContentCbx" Width="377" Height="32" Margin="16,0,16,0" ItemsSource="{Binding PrintContentList}" SelectedIndex="{Binding PrintContentIndex}" >
  107. <i:Interaction.Triggers>
  108. <i:EventTrigger EventName="SelectionChanged">
  109. <i:InvokeCommandAction Command="{Binding SetPrintContentCommand}" CommandParameter="{Binding ElementName=PrintContentCbx}"></i:InvokeCommandAction>
  110. </i:EventTrigger>
  111. </i:Interaction.Triggers>
  112. </ComboBox>
  113. </StackPanel>
  114. <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
  115. <CheckBox x:Name="ReversePageCbx" VerticalAlignment="Center" Command="{Binding SetReversePageCommand}" CommandParameter="{Binding ElementName=ReversePageCbx}">
  116. <TextBlock Text="Reverse pages" FontFamily="Segoe UI" FontSize="14"/>
  117. </CheckBox>
  118. <CheckBox x:Name="PrintBorderCbx" VerticalAlignment="Center" Margin="25,0,0,0" Command="{Binding SetPrintBorderCommand}" CommandParameter="{Binding ElementName=PrintBorderCbx}" Visibility="{Binding PrintPageBorderVisibility}">
  119. <TextBlock Text="Print page border" FontFamily="Segoe UI" FontSize="14"/>
  120. </CheckBox>
  121. </StackPanel>
  122. </StackPanel>
  123. <StackPanel Grid.Row="2" Orientation="Vertical" Margin="0,18,0,0">
  124. <StackPanel Orientation="Horizontal">
  125. <TextBlock Text="Page Sizing &amp; Handling" FontFamily="Segoe UI" FontSize="12" Foreground="#616469"/>
  126. <Button Content="?" FontSize="6" Width="16" Height="16" Margin="9,0,0,0"></Button>
  127. </StackPanel>
  128. <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
  129. <RadioButton Style="{StaticResource ListModeRadioBtnStyle}" x:Name="ModSizeRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModSizeRdo}" Background="WhiteSmoke" Width="111" Height="32" IsChecked="True">
  130. <Border>
  131. <TextBlock Text="Size" FontFamily="Segoe UI" FontSize="14"/>
  132. </Border>
  133. </RadioButton>
  134. <!--Button Name="ModPoster" Background="WhiteSmoke" Width="126" Height="32" Margin="25,0,25,0" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModPoster}"-->
  135. <RadioButton Style="{StaticResource ListModeRadioBtnStyle}" Name="ModPosterRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModPosterRdo}" Background="WhiteSmoke" Width="111" Height="32" Margin="8,0,8,0">
  136. <Border>
  137. <TextBlock Text="Poster" FontFamily="Segoe UI" FontSize="14"></TextBlock>
  138. </Border>
  139. </RadioButton>
  140. <RadioButton Style="{StaticResource ListModeRadioBtnStyle}" Name="ModMultipleRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModMultipleRdo}" Background="WhiteSmoke" Width="111" Height="32" Margin="0,0,8,0">
  141. <Border>
  142. <TextBlock Text="Multiple" FontFamily="Segoe UI" FontSize="14"></TextBlock>
  143. </Border>
  144. </RadioButton>
  145. <RadioButton Style="{StaticResource ListModeRadioBtnStyle}" Name="ModBookletRdo" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModBookletRdo}" Background="WhiteSmoke" Width="111" Height="32" Margin="0,0,16,0">
  146. <Border>
  147. <TextBlock Text="Booklet" FontFamily="Segoe UI" FontSize="14"></TextBlock>
  148. </Border>
  149. </RadioButton>
  150. </StackPanel>
  151. </StackPanel>
  152. </Grid>
  153. <Grid Grid.Row="1" Margin="0,0,8,0" VerticalAlignment="Top">
  154. <Grid.ColumnDefinitions>
  155. <ColumnDefinition Width="29*"/>
  156. <ColumnDefinition Width="213*"/>
  157. </Grid.ColumnDefinitions>
  158. <ContentControl prism:RegionManager.RegionName="{Binding HomePagePrinterModRegionName}" Visibility="Visible" Grid.ColumnSpan="2"/>
  159. </Grid>
  160. </Grid>
  161. </Grid>
  162. </Grid>
  163. <Grid Grid.Row="2">
  164. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="15,0,0,16">
  165. <Button Width="80" Height="32" Content="Print" Margin="0,0,16,0" Command="{Binding ConfirmPrintCommand}"></Button>
  166. <Button Width="80" Height="32" Content="Cancel" Margin="0,0,16,0" Command="{Binding CancelCommand}"></Button>
  167. </StackPanel>
  168. </Grid>
  169. </Grid>
  170. </UserControl>