HomePagePrinterDialog.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
  7. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  8. xmlns:prism="http://prismlibrary.com/"
  9. xmlns:homepageprinter="clr-namespace:PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter"
  10. d:DataContext="{d:DesignInstance Type=homepageprinter:HomePagePrinterDialogViewModel}"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. d:DesignHeight="650"
  13. d:DesignWidth="903"
  14. mc:Ignorable="d"
  15. >
  16. <Grid>
  17. <Grid.RowDefinitions>
  18. <RowDefinition Height="50"></RowDefinition>
  19. <RowDefinition Height="*"></RowDefinition>
  20. <RowDefinition Height="63"></RowDefinition>
  21. </Grid.RowDefinitions>
  22. <TextBlock Grid.Row="0" Text="打印" FontSize="20" FontWeight="ExtraBlack" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="20,0,0,0" Height="28" Width="120"/>
  23. <Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1,0,1" VerticalAlignment="Center" Height="537">
  24. <Grid>
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="2*"/>
  27. <ColumnDefinition Width="4*"/>
  28. </Grid.ColumnDefinitions>
  29. <Grid Grid.Column="0">
  30. <Border Height="430" Width="269" Background="LightGray" HorizontalAlignment="Center" VerticalAlignment="Center">
  31. <Grid>
  32. <Grid.RowDefinitions>
  33. <RowDefinition Height="36"></RowDefinition>
  34. <RowDefinition></RowDefinition>
  35. </Grid.RowDefinitions>
  36. <Grid>
  37. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
  38. <TextBlock Text="大小:"></TextBlock>
  39. <TextBlock Text="{Binding PaperWidth}"></TextBlock>
  40. <TextBlock Text="*"></TextBlock>
  41. <TextBlock Text="{Binding PaperHeight}"></TextBlock>
  42. <TextBlock Text="mm"></TextBlock>
  43. </StackPanel>
  44. </Grid>
  45. <Grid Grid.Row="1" Width="{Binding ViewBoxWidth}" Height="{Binding ViewBoxHeight}">
  46. <Grid.RenderTransform>
  47. <RotateTransform Angle="{Binding RotateAngle}" CenterX="{Binding RotateCenterX}" CenterY="{Binding RotateCenterY}"></RotateTransform>
  48. </Grid.RenderTransform>
  49. <Border Background="White" CornerRadius="1" Width="{Binding CanvasWidth, Mode=OneWay}" Height="{Binding CanvasHeight,Mode=OneWay}" >
  50. <Viewbox Width="{Binding ViewBoxWidth}" Height="{Binding ViewBoxHeight}" Margin="{Binding ViewBoxMargin}">
  51. <Image Name="Image" Source="{Binding BitmapSource}"></Image>
  52. </Viewbox>
  53. </Border>
  54. </Grid>
  55. </Grid>
  56. </Border>
  57. <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom">
  58. <Button Name="PrePageBtn" Width="20" Height="20" HorizontalAlignment="Left" FontSize="16" Background="WhiteSmoke" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsEnabled="{Binding IsEnableForGetPreviousPage}" Click="PrePageBtn_Click">
  59. <TextBlock Text="&lt;" VerticalAlignment="Center"></TextBlock>
  60. </Button>
  61. <TextBox x:Name="CurrentPageIndexTextBox" Width="30" Height="25" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10,0,5,0" Text="{Binding CurrentListIndexString, Mode=OneWay}" input:InputMethod.IsInputMethodEnabled="False" PreviewTextInput="CurrentPageIndexTextBox_PreviewTextInput" KeyDown="CurrentPageIndexTextBox_KeyDown" ></TextBox>
  62. <TextBlock Text="of" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0"></TextBlock>
  63. <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Text="{Binding MaxPageNumber}"></TextBlock>
  64. <Button Name="NextPageBtn" Width="20" Height="20" HorizontalAlignment="Left" FontSize="16" Background="WhiteSmoke" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsEnabled="{Binding IsEnableForGetNextPage }" Click="NextPageBtn_Click">
  65. <TextBlock Text=">" VerticalAlignment="Center"></TextBlock>
  66. </Button>
  67. </StackPanel>
  68. </Grid>
  69. <Grid Grid.Column="1">
  70. <Grid.RowDefinitions>
  71. <RowDefinition Height="1.2*"/>
  72. <RowDefinition Height="0.9*"/>
  73. <RowDefinition Height="2*"/>
  74. </Grid.RowDefinitions>
  75. <Grid Grid.Row="0">
  76. <StackPanel Orientation="Vertical">
  77. <StackPanel Orientation="Horizontal" Margin="0,60,0,0">
  78. <StackPanel Orientation="Horizontal">
  79. <TextBlock Text="打印机: " Height="20" Width="56" ></TextBlock>
  80. <ComboBox Width="277" Height="32" Margin="8,0,0,0" ItemsSource="{Binding PrinterNameList}" SelectedIndex="{Binding PrinterIndex}"></ComboBox>
  81. </StackPanel>
  82. <Button Content="页面设置" Height="32" Width="91" Margin="31,0,0,0" Command="{Binding SetPaperSizeCommand}"/>
  83. </StackPanel>
  84. <StackPanel Orientation="Horizontal" Margin="0,19,0,0">
  85. <StackPanel Orientation="Horizontal">
  86. <TextBlock Text="预置: " Height="20" Width="42"></TextBlock>
  87. <ComboBox Width="139" Height="32" Margin="22,0,0,0"></ComboBox>
  88. </StackPanel>
  89. <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
  90. <TextBlock Height="20" Width="42" Text="份数: "></TextBlock>
  91. <cus:NumericUpDown Height="32" Width="76" Margin="15,0,0,0"></cus:NumericUpDown>
  92. </StackPanel>
  93. <CheckBox VerticalAlignment="Center" Margin="27,0,0,0" IsChecked="{Binding IsBlackAndWhite}" Command="{Binding SetIsBlackAndWhiteCommand}">
  94. <TextBlock Text="黑白色 "/>
  95. </CheckBox>
  96. <CheckBox VerticalAlignment="Center" Margin="27,0,0,0">
  97. <TextBlock Text="双面打印"/>
  98. </CheckBox>
  99. </StackPanel>
  100. </StackPanel>
  101. </Grid>
  102. <Grid Grid.Row="1">
  103. <StackPanel Orientation="Vertical">
  104. <TextBlock Text="打印设置" FontWeight="ExtraBlack"/>
  105. <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
  106. <StackPanel Orientation="Horizontal">
  107. <TextBlock Text="页面范围: " Height="20" Width="70"></TextBlock>
  108. <cus:WritableComboBox x:Name="PageRangeComboBox" Width="190" Height="32" Margin="10,0,0,0" Loaded="PageRangeComboBox_Loaded" Text="{Binding CustomPageRange}" IsCurrentPage="{Binding IsCurrentPage}" SelectedIndex="{Binding PageRangeIndex, Mode=TwoWay}"></cus:WritableComboBox>
  109. </StackPanel>
  110. <StackPanel Orientation="Horizontal" Margin="35,0,0,0">
  111. <TextBlock Text="打印方向: " Height="20" Width="70"></TextBlock>
  112. <ComboBox Name="PrintOrientationComboBox" Width="190" Height="32" Margin="10,0,0,0" ItemsSource="{Binding PrintOrientationList}" SelectedIndex="{Binding PrintOrientationIndex, Mode=TwoWay}" SelectionChanged="PrintOrientationComboBox_SelectionChanged"></ComboBox>
  113. </StackPanel>
  114. </StackPanel>
  115. <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
  116. <StackPanel Orientation="Horizontal">
  117. <TextBlock Text="打印内容: " Height="20" Width="70"></TextBlock>
  118. <ComboBox Width="190" Height="32" Margin="10,0,0,0" ItemsSource="{Binding PrintContentList}" SelectedIndex="{Binding PrintContentIndex}" SelectionChanged="ComboBox_SelectionChanged"></ComboBox>
  119. </StackPanel>
  120. <CheckBox x:Name="ReversePageCheckBox" Margin="35,0,0,0" VerticalAlignment="Center" IsChecked="{Binding IsPageIndexReverse}" Command="{Binding SetIsPageIndexReverseCommand}" Click="ReversePageCheckBox_Click">
  121. <TextBlock Text="逆页序打印"/>
  122. </CheckBox>
  123. </StackPanel>
  124. </StackPanel>
  125. </Grid>
  126. <Grid Grid.Row="2">
  127. <StackPanel Height="auto" Orientation="Vertical">
  128. <StackPanel Orientation="Horizontal">
  129. <TextBlock Text="调整页面大小和处理页面" FontWeight="ExtraBlack"/>
  130. <Button Content="?" FontSize="6" Width="16" Height="16" Margin="7,0,0,0"></Button>
  131. </StackPanel>
  132. <StackPanel Orientation="Horizontal" Margin="0,10,0,0">
  133. <Button x:Name="ModSize" Background="WhiteSmoke" Width="126" Height="32" IsEnabled="{Binding IsEnableForModSize, Mode=OneWay}" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModSize}">
  134. <Border>
  135. <TextBlock Text="大小"/>
  136. </Border>
  137. </Button>
  138. <!--Button Name="ModPoster" Background="WhiteSmoke" Width="126" Height="32" Margin="25,0,25,0" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModPoster}"-->
  139. <Button Name="ModPoster" Background="WhiteSmoke" Width="126" Height="32" Margin="25,0,25,0" IsEnabled="{Binding IsEnableForModPoster, Mode=OneWay}">
  140. <Border>
  141. <TextBlock Text="海报"></TextBlock>
  142. </Border>
  143. </Button>
  144. <Button Name="ModMultiple" Background="WhiteSmoke" Width="126" Height="32" Margin="0,0,25,0" IsEnabled="{Binding IsEnableForModMultiple, Mode=OneWay}" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModMultiple}">
  145. <Border>
  146. <TextBlock Text="多页"></TextBlock>
  147. </Border>
  148. </Button>
  149. <Button Name="ModBooklet" Background="WhiteSmoke" Width="126" Height="32" Margin="0,0,10,0" IsEnabled="{Binding IsEnableForModBooklet, Mode=OneWay}" Command="{Binding ChangePrintModCommand}" CommandParameter="{Binding ElementName=ModBooklet}">
  150. <Border>
  151. <TextBlock Text="小册子"></TextBlock>
  152. </Border>
  153. </Button>
  154. </StackPanel>
  155. <StackPanel>
  156. <Grid>
  157. <Grid.RowDefinitions>
  158. <RowDefinition Height="47*"/>
  159. <RowDefinition Height="4*"/>
  160. </Grid.RowDefinitions>
  161. <ContentControl Height="180" Margin="12,12,12,12" x:Name="PrintMod" prism:RegionManager.RegionName="{Binding PrintModRegionName}" Visibility="{Binding PrintModVisible}" Grid.RowSpan="2"/>
  162. </Grid>
  163. </StackPanel>
  164. </StackPanel>
  165. </Grid>
  166. </Grid>
  167. </Grid>
  168. </Border>
  169. <Grid Grid.Row="2">
  170. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="15,0,0,0">
  171. <Button Width="98" Height="32" Content="取消" Margin="0,0,10,0"></Button>
  172. <Button Width="98" Height="32" Content="打印" Margin="0,0,16,0" Command="{Binding ConfirmPrintCommand}"></Button>
  173. </StackPanel>
  174. </Grid>
  175. </Grid>
  176. </UserControl>