HomePagePrinterDocumentContent.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <UserControl
  2. x:Class="PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePagePrinter.HomePagePrinterDocumentContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  6. xmlns:prism="http://prismlibrary.com/"
  7. prism:ViewModelLocator.AutoWireViewModel="True">
  8. <UserControl.Resources>
  9. <Style x:Key="PrePageBtnStyle" TargetType="Button">
  10. <Setter Property="Height" Value="24" />
  11. <Setter Property="Width" Value="24" />
  12. <Setter Property="Template">
  13. <Setter.Value>
  14. <ControlTemplate TargetType="{x:Type Button}">
  15. <Grid x:Name="UserfulRegion">
  16. <Border
  17. x:Name="border"
  18. BorderBrush="{StaticResource color.field.border.norm}"
  19. BorderThickness="1"
  20. CornerRadius="4">
  21. <Grid>
  22. <Rectangle
  23. Width="24"
  24. Height="24"
  25. Fill="Transparent" />
  26. <Path
  27. x:Name="Path"
  28. Width="24"
  29. Height="24"
  30. HorizontalAlignment="Center"
  31. VerticalAlignment="Center"
  32. Data="M10.0607 12.1L14.6303 7.53039L13.5696 6.46973L8.46967 11.5697C8.17678 11.8626 8.17678 12.3374 8.46967 12.6303L13.5696 17.7303L14.6303 16.6696L10.0607 12.1Z"
  33. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  34. </Grid>
  35. </Border>
  36. </Grid>
  37. <ControlTemplate.Triggers>
  38. <Trigger Property="IsMouseOver" Value="True">
  39. <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  40. </Trigger>
  41. </ControlTemplate.Triggers>
  42. </ControlTemplate>
  43. </Setter.Value>
  44. </Setter>
  45. </Style>
  46. <Style x:Key="NextPageBtnStyle" TargetType="Button">
  47. <Setter Property="Template">
  48. <Setter.Value>
  49. <ControlTemplate TargetType="{x:Type Button}">
  50. <Grid x:Name="UserfulRegion">
  51. <Border
  52. x:Name="border"
  53. BorderBrush="{StaticResource color.field.border.norm}"
  54. BorderThickness="1"
  55. CornerRadius="4">
  56. <Grid>
  57. <Rectangle
  58. Width="24"
  59. Height="24"
  60. Fill="Transparent" />
  61. <Path
  62. x:Name="Path"
  63. Width="24"
  64. Height="24"
  65. HorizontalAlignment="Center"
  66. VerticalAlignment="Center"
  67. Data="M13.9393 12.1L9.36972 7.53039L10.4304 6.46973L15.5303 11.5697C15.8232 11.8626 15.8232 12.3374 15.5303 12.6303L10.4304 17.7303L9.36972 16.6696L13.9393 12.1Z"
  68. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  69. </Grid>
  70. </Border>
  71. </Grid>
  72. <ControlTemplate.Triggers>
  73. <Trigger Property="IsMouseOver" Value="True">
  74. <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  75. </Trigger>
  76. </ControlTemplate.Triggers>
  77. </ControlTemplate>
  78. </Setter.Value>
  79. </Setter>
  80. </Style>
  81. <Style x:Key="PageTxtStyle" TargetType="TextBox">
  82. <Setter Property="Height" Value="24" />
  83. <Setter Property="Width" Value="57" />
  84. <Setter Property="Template">
  85. <Setter.Value>
  86. <ControlTemplate TargetType="TextBox">
  87. <Border
  88. Background="{StaticResource color.field.bg.def}"
  89. BorderBrush="{StaticResource color.field.border.norm}"
  90. BorderThickness="1"
  91. CornerRadius="4">
  92. <ScrollViewer
  93. x:Name="PART_ContentHost"
  94. MinHeight="20"
  95. VerticalAlignment="Center"
  96. Focusable="false"
  97. HorizontalScrollBarVisibility="Hidden"
  98. VerticalScrollBarVisibility="Hidden" />
  99. </Border>
  100. </ControlTemplate>
  101. </Setter.Value>
  102. </Setter>
  103. </Style>
  104. </UserControl.Resources>
  105. <Grid Width="212" Height="356">
  106. <Border
  107. Width="212"
  108. Height="356"
  109. HorizontalAlignment="Center"
  110. VerticalAlignment="Top"
  111. Background="{StaticResource color.sys.layout.mg}"
  112. CornerRadius="8">
  113. <Grid>
  114. <Grid.RowDefinitions>
  115. <RowDefinition Height="52" />
  116. <RowDefinition />
  117. <RowDefinition Height="56" />
  118. </Grid.RowDefinitions>
  119. <Grid Grid.Row="0" Margin="16">
  120. <StackPanel
  121. HorizontalAlignment="Center"
  122. VerticalAlignment="Bottom"
  123. Orientation="Horizontal">
  124. <TextBlock
  125. FontFamily="Segoe UI"
  126. FontSize="12"
  127. Text="size:" />
  128. <TextBlock
  129. FontFamily="Segoe UI"
  130. FontSize="12"
  131. Text="{Binding PaperWidth}" />
  132. <TextBlock
  133. FontFamily="Segoe UI"
  134. FontSize="12"
  135. Text="*" />
  136. <TextBlock
  137. FontFamily="Segoe UI"
  138. FontSize="12"
  139. Text="{Binding PaperHeight}" />
  140. <TextBlock
  141. FontFamily="Segoe UI"
  142. FontSize="12"
  143. Text="mm" />
  144. </StackPanel>
  145. </Grid>
  146. <Border
  147. Grid.Row="1"
  148. Width="{Binding ViewBoxWidth}"
  149. Height="{Binding ViewBoxHeight}"
  150. BorderBrush="#19000000"
  151. BorderThickness="1"
  152. CornerRadius="2">
  153. <Grid Background="White">
  154. <Viewbox>
  155. <Image
  156. Name="Image"
  157. RenderOptions.BitmapScalingMode="HighQuality"
  158. Source="{Binding BitmapSource}" />
  159. </Viewbox>
  160. </Grid>
  161. </Border>
  162. <Grid Grid.Row="2">
  163. <StackPanel
  164. HorizontalAlignment="Center"
  165. VerticalAlignment="Center"
  166. Orientation="Horizontal">
  167. <Button
  168. Name="PrePageBtn"
  169. Width="24"
  170. Height="24"
  171. HorizontalAlignment="Left"
  172. HorizontalContentAlignment="Center"
  173. VerticalContentAlignment="Center"
  174. Background="WhiteSmoke"
  175. Command="{Binding TurnPageCommand}"
  176. CommandParameter="{Binding ElementName=PrePageBtn}"
  177. FontSize="16"
  178. Style="{StaticResource PrePageBtnStyle}"
  179. Tag="PrePage" />
  180. <TextBox
  181. x:Name="CurrentPageIndexTxt"
  182. Margin="10,0,5,0"
  183. HorizontalContentAlignment="Center"
  184. VerticalContentAlignment="Center"
  185. Style="{StaticResource PageTxtStyle}"
  186. Text="{Binding TargetPaperIndex, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
  187. <i:Interaction.Triggers>
  188. <i:EventTrigger x:Name="PropertyChanged">
  189. <i:InvokeCommandAction Command="{Binding JumpPageCommand}" CommandParameter="{Binding ElementName=CurrentPageIndexTxt}" />
  190. </i:EventTrigger>
  191. </i:Interaction.Triggers>
  192. </TextBox>
  193. <TextBlock
  194. Margin="0"
  195. HorizontalAlignment="Left"
  196. VerticalAlignment="Center"
  197. FontFamily="Segoe UI"
  198. FontSize="14"
  199. Text="of" />
  200. <TextBlock
  201. Margin="5"
  202. HorizontalAlignment="Left"
  203. VerticalAlignment="Center"
  204. Text="{Binding PrintedPageCount}" />
  205. <Button
  206. Name="NextPageBtn"
  207. Width="24"
  208. Height="24"
  209. HorizontalAlignment="Left"
  210. HorizontalContentAlignment="Center"
  211. VerticalContentAlignment="Center"
  212. Background="WhiteSmoke"
  213. Command="{Binding TurnPageCommand}"
  214. CommandParameter="{Binding ElementName=NextPageBtn}"
  215. FontSize="16"
  216. Style="{StaticResource NextPageBtnStyle}"
  217. Tag="NextPage" />
  218. </StackPanel>
  219. </Grid>
  220. </Grid>
  221. </Border>
  222. </Grid>
  223. </UserControl>