HomePagePrinterDialog.xaml 14 KB

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