PageContent.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <UserControl
  2. x:Class="PDF_Master.Views.PropertyPanel.ViewModular.PageContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:Convert="clr-namespace:PDF_Master.DataConvert"
  6. xmlns:DataConvert="clr-namespace:PDF_Master.DataConvert"
  7. xmlns:ViewModular="clr-namespace:PDF_Master.ViewModels.PropertyPanel.ViewModular"
  8. xmlns:customControl="clr-namespace:PDF_Master.CustomControl"
  9. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  10. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  11. xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.ViewModular"
  12. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  13. xmlns:prism="http://prismlibrary.com/"
  14. d:DataContext="{d:DesignInstance Type=ViewModular:PageContentViewModel}"
  15. d:DesignHeight="32"
  16. d:DesignWidth="332"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. Background="Transparent"
  19. mc:Ignorable="d">
  20. <UserControl.Resources>
  21. <ResourceDictionary>
  22. <ResourceDictionary.MergedDictionaries>
  23. <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
  24. </ResourceDictionary.MergedDictionaries>
  25. <Convert:ObjectConvert x:Key="ObjectConvert" />
  26. <PathGeometry x:Key="Ic_FirstPageButtonPath" Figures="M5.25 6V18H6.75V6H5.25ZM12.8803 8.93035L10.5607 11.25H18.95V12.75H10.5607L12.8803 15.0696L11.8196 16.1303L8.21967 12.5303C7.92678 12.2374 7.92678 11.7626 8.21967 11.4697L11.8196 7.86969L12.8803 8.93035Z" />
  27. <PathGeometry x:Key="Ic_PrePageButtonPath" Figures="M7.61071 11.2499L9.93035 8.93029L8.86969 7.86963L5.26972 11.4696C4.97683 11.7625 4.97683 12.2374 5.26972 12.5303L8.86969 16.1302L9.93035 15.0696L7.61071 12.7499H19V11.2499H7.61071Z" />
  28. <PathGeometry x:Key="Ic_NextPageButtonPath" Figures="M16.3893 11.2499L5 11.2499V12.7499L16.3893 12.7499L14.0697 15.0696L15.1303 16.1302L18.7303 12.5303C19.0232 12.2374 19.0232 11.7625 18.7303 11.4696L15.1303 7.86963L14.0697 8.93029L16.3893 11.2499Z" />
  29. <PathGeometry x:Key="Ic_LastPageButtonPath" Figures="M17.25 6V18H18.75V6H17.25ZM11.0697 15.0697L13.3893 12.75L5 12.75V11.25L13.3893 11.25L11.0697 8.93038L12.1303 7.86972L15.7303 11.4697C16.0232 11.7626 16.0232 12.2375 15.7303 12.5304L12.1303 16.1303L11.0697 15.0697Z" />
  30. </ResourceDictionary>
  31. </UserControl.Resources>
  32. <Border
  33. CornerRadius="4" Background="{StaticResource color.sys.layout.anti}" Effect="{StaticResource shadow.neutral.m}">
  34. <StackPanel Name="ParentPanel" Orientation="Horizontal" >
  35. <StackPanel Orientation="Horizontal" Margin="16,0,16,0" MinWidth="219" >
  36. <Border
  37. Width="24"
  38. Height="24"
  39. Margin="0,0,8,0"
  40. BorderBrush="#DFE1E5"
  41. BorderThickness="1"
  42. CornerRadius="4">
  43. <customControl:PathButton
  44. x:Name="BtnFirstPage"
  45. Command="{Binding FirstPageCommand}"
  46. Icon="{StaticResource Ic_FirstPageButtonPath}"
  47. IconFill="#616469"
  48. IconMouseOver="{StaticResource Ic_FirstPageButtonPath}"
  49. IconMouseOverFill="#616469"
  50. IconPress="{StaticResource Ic_FirstPageButtonPath}"
  51. IconPressFill="#616469" />
  52. </Border>
  53. <Border
  54. Width="24"
  55. Height="24"
  56. Margin="0,0,8,0"
  57. BorderBrush="#DFE1E5"
  58. BorderThickness="1"
  59. CornerRadius="4">
  60. <customControl:PathButton
  61. x:Name="BtnPrePage"
  62. Command="{Binding PrePageCommand}"
  63. Icon="{StaticResource Ic_PrePageButtonPath}"
  64. IconFill="#616469"
  65. IconMouseOver="{StaticResource Ic_PrePageButtonPath}"
  66. IconMouseOverFill="#616469"
  67. IconPress="{StaticResource Ic_PrePageButtonPath}"
  68. IconPressFill="#616469" />
  69. </Border>
  70. <Border
  71. Width="57"
  72. Height="24"
  73. BorderBrush="#DFE1E5"
  74. BorderThickness="1"
  75. CornerRadius="4">
  76. <TextBox
  77. Width="54"
  78. VerticalAlignment="Center"
  79. Background="Transparent"
  80. BorderBrush="Transparent"
  81. BorderThickness="0"
  82. InputMethod.IsInputMethodEnabled="False"
  83. Foreground="#252629"
  84. Text="{Binding CurrentPage}"
  85. TextAlignment="Left">
  86. <i:Interaction.Triggers>
  87. <i:EventTrigger EventName="KeyDown">
  88. <i:InvokeCommandAction Command="{Binding PageTextKeyDownCommand}" PassEventArgsToCommand="True" />
  89. </i:EventTrigger>
  90. <i:EventTrigger EventName="PreviewKeyDown">
  91. <i:InvokeCommandAction Command="{Binding PageTextPreviewKeyDownCommand}" PassEventArgsToCommand="True" />
  92. </i:EventTrigger>
  93. <i:EventTrigger EventName="LostFocus">
  94. <i:InvokeCommandAction Command="{Binding PageTextFocusableChangedCommand}" PassEventArgsToCommand="True" />
  95. </i:EventTrigger>
  96. </i:Interaction.Triggers>
  97. </TextBox>
  98. </Border>
  99. <TextBlock
  100. Margin="8,0,0,0"
  101. x:Name="TxtPageCount"
  102. Height="32"
  103. MinWidth="34"
  104. Padding="0,5.5,0,0"
  105. FontFamily="Segoe UI"
  106. FontSize="14"
  107. Foreground="#252629"
  108. Text="{Binding PageCount, StringFormat=/ {0}}"
  109. TextAlignment="Left" />
  110. <Border
  111. Width="24"
  112. Height="24"
  113. Margin="0,0,8,0"
  114. BorderBrush="#DFE1E5"
  115. BorderThickness="1"
  116. CornerRadius="4">
  117. <customControl:PathButton
  118. x:Name="BtnNextPage"
  119. Command="{Binding NextPageCommand}"
  120. Icon="{StaticResource Ic_NextPageButtonPath}"
  121. IconFill="#616469"
  122. IconMouseOver="{StaticResource Ic_NextPageButtonPath}"
  123. IconMouseOverFill="#616469"
  124. IconPress="{StaticResource Ic_NextPageButtonPath}"
  125. IconPressFill="#616469" />
  126. </Border>
  127. <Border
  128. Width="24"
  129. Height="24"
  130. Margin="0,0,8,0"
  131. BorderBrush="#DFE1E5"
  132. BorderThickness="1"
  133. CornerRadius="4">
  134. <customControl:PathButton
  135. x:Name="BtnLastPage"
  136. Command="{Binding LastPageCommand}"
  137. Icon="{StaticResource Ic_LastPageButtonPath}"
  138. IconFill="#616469"
  139. IconMouseOver="{StaticResource Ic_LastPageButtonPath}"
  140. IconMouseOverFill="#616469"
  141. IconPress="{StaticResource Ic_LastPageButtonPath}"
  142. IconPressFill="#616469" />
  143. </Border>
  144. </StackPanel>
  145. <Border
  146. Width="70"
  147. Height="24"
  148. Margin="0,0,11,0"
  149. BorderBrush="#E2E3E6"
  150. BorderThickness="0">
  151. <Grid>
  152. <ComboBox
  153. Name="ZoomBox"
  154. Background="Transparent"
  155. BorderBrush="Transparent"
  156. BorderThickness="0"
  157. MaxDropDownHeight="510"
  158. SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  159. <ComboBoxItem x:Name="ActualSize" Style="{StaticResource ZoomComboxItemStyle}">
  160. <StackPanel Orientation="Horizontal">
  161. <Border x:Name="ActualSizeBorder" Margin="7,0,12,0">
  162. <!--<Path Fill="Black" VerticalAlignment="Center" HorizontalAlignment="Center" Data="M10.807106,0.0999999046 L15.0999992,5.39289312 L15.0999992,15.8999991 L0.899999857,15.8999991 L0.899999857,0.0999999046 L10.807106,0.0999999046 Z M10.3929999,1.0999999 L1.89999986,1.0999999 L1.89999986,14.8989999 L14.0989999,14.8989999 L14.0989999,5.8059999 L10.3929999,1.0999999 Z M8,10.53125 C8.15885417,10.53125 8.29361979,10.5833333 8.40429688,10.6875 C8.51497396,10.7916667 8.5703125,10.9166667 8.5703125,11.0625 C8.5703125,11.2057292 8.51497396,11.328776 8.40429688,11.4316406 C8.29361979,11.5345052 8.15885417,11.5859375 8,11.5859375 C7.84375,11.5859375 7.7109375,11.5345052 7.6015625,11.4316406 C7.4921875,11.328776 7.4375,11.2057292 7.4375,11.0625 C7.4375,10.9166667 7.4921875,10.7916667 7.6015625,10.6875 C7.7109375,10.5833333 7.84375,10.53125 8,10.53125 Z M6.21875,5.7734375 L6.21875,11.5 L5.3125,11.5 L5.3125,6.8828125 C5.1484375,7 4.97200521,7.09960938 4.78320312,7.18164062 C4.59440104,7.26367188 4.37890625,7.3359375 4.13671875,7.3984375 L4.13671875,7.3984375 L4.13671875,6.625 C4.28776042,6.57552083 4.43359375,6.5234375 4.57421875,6.46875 C4.71484375,6.4140625 4.85351562,6.35286458 4.99023438,6.28515625 C5.12695312,6.21744792 5.26497396,6.14192708 5.40429688,6.05859375 C5.54361979,5.97526042 5.6875,5.88020833 5.8359375,5.7734375 L5.8359375,5.7734375 L6.21875,5.7734375 Z M11.3671875,5.7734375 L11.3671875,11.5 L10.4609375,11.5 L10.4609375,6.8828125 C10.296875,7 10.1204427,7.09960938 9.93164062,7.18164062 C9.74283854,7.26367188 9.52734375,7.3359375 9.28515625,7.3984375 L9.28515625,7.3984375 L9.28515625,6.625 C9.43619792,6.57552083 9.58203125,6.5234375 9.72265625,6.46875 C9.86328125,6.4140625 10.0019531,6.35286458 10.1386719,6.28515625 C10.2753906,6.21744792 10.4134115,6.14192708 10.5527344,6.05859375 C10.6920573,5.97526042 10.8359375,5.88020833 10.984375,5.7734375 L10.984375,5.7734375 L11.3671875,5.7734375 Z M8,7.44140625 C8.15885417,7.44140625 8.29361979,7.49348958 8.40429688,7.59765625 C8.51497396,7.70182292 8.5703125,7.82682292 8.5703125,7.97265625 C8.5703125,8.11588542 8.51497396,8.23893229 8.40429688,8.34179688 C8.29361979,8.44466146 8.15885417,8.49609375 8,8.49609375 C7.84375,8.49609375 7.7109375,8.44466146 7.6015625,8.34179688 C7.4921875,8.23893229 7.4375,8.11588542 7.4375,7.97265625 C7.4375,7.82682292 7.4921875,7.70182292 7.6015625,7.59765625 C7.7109375,7.49348958 7.84375,7.44140625 8,7.44140625 Z" />-->
  163. </Border>
  164. <TextBlock
  165. x:Name="ActualSizeText"
  166. VerticalAlignment="Center"
  167. Text="Actual Size" />
  168. </StackPanel>
  169. </ComboBoxItem>
  170. <ComboBoxItem x:Name="FitWidth" Style="{StaticResource ZoomComboxItemStyle}">
  171. <StackPanel Orientation="Horizontal ">
  172. <Border Name="FitWidthBorder" Margin="7,0,12,0">
  173. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/fitwidth.png" />-->
  174. </Border>
  175. <TextBlock x:Name="FitWidthText" Text="Fit Width" />
  176. </StackPanel>
  177. </ComboBoxItem>
  178. <ComboBoxItem x:Name="FitHeight" Style="{StaticResource ZoomComboxItemStyle}">
  179. <StackPanel Orientation="Horizontal">
  180. <Border Name="FitHeightBorder" Margin="7,0,12,0">
  181. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/adaptationHeight.png" />-->
  182. </Border>
  183. <TextBlock x:Name="FitHeightText" Text="Fit Height" />
  184. </StackPanel>
  185. </ComboBoxItem>
  186. <Separator
  187. Height="1"
  188. BorderBrush="#33000000"
  189. BorderThickness="1"
  190. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  191. <ComboBoxItem
  192. Padding="30,0,0,0"
  193. Content="10%"
  194. Style="{StaticResource ZoomComboxItemStyle}"
  195. Tag="10" />
  196. <ComboBoxItem
  197. Padding="30,0,0,0"
  198. Content="25%"
  199. Style="{StaticResource ZoomComboxItemStyle}"
  200. Tag="25" />
  201. <ComboBoxItem
  202. Padding="30,0,0,0"
  203. Content="50%"
  204. Style="{StaticResource ZoomComboxItemStyle}"
  205. Tag="50" />
  206. <ComboBoxItem
  207. Padding="30,0,0,0"
  208. Content="100%"
  209. Style="{StaticResource ZoomComboxItemStyle}"
  210. Tag="100" />
  211. <ComboBoxItem
  212. Padding="30,0,0,0"
  213. Content="150%"
  214. Style="{StaticResource ZoomComboxItemStyle}"
  215. Tag="150" />
  216. <ComboBoxItem
  217. Padding="30,0,0,0"
  218. Content="200%"
  219. Style="{StaticResource ZoomComboxItemStyle}"
  220. Tag="200" />
  221. <ComboBoxItem
  222. Padding="30,0,0,0"
  223. Content="300%"
  224. Style="{StaticResource ZoomComboxItemStyle}"
  225. Tag="300" />
  226. <ComboBoxItem
  227. Padding="30,0,0,0"
  228. Content="400%"
  229. Style="{StaticResource ZoomComboxItemStyle}"
  230. Tag="400" />
  231. <ComboBoxItem
  232. Padding="30,0,0,0"
  233. Content="500%"
  234. Style="{StaticResource ZoomComboxItemStyle}"
  235. Tag="500" />
  236. <ComboBoxItem
  237. Padding="30,0,0,0"
  238. Content="1000%"
  239. Style="{StaticResource ZoomComboxItemStyle}"
  240. Tag="1000" />
  241. <i:Interaction.Triggers>
  242. <i:EventTrigger EventName="SelectionChanged">
  243. <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True" />
  244. </i:EventTrigger>
  245. </i:Interaction.Triggers>
  246. </ComboBox>
  247. <TextBox
  248. Name="TxtZoom"
  249. Height="20"
  250. Margin="2,0,25,0"
  251. TextAlignment="Right"
  252. VerticalAlignment="Center"
  253. Background="White"
  254. BorderThickness="0"
  255. FontFamily="Segoe UI"
  256. FontSize="14"
  257. IsReadOnly="True"
  258. Text="{Binding CurrentZoom, StringFormat={}{0}%}"
  259. />
  260. </Grid>
  261. </Border>
  262. </StackPanel>
  263. </Border>
  264. <!--<i:Interaction.Triggers>
  265. <i:EventTrigger EventName="Loaded">
  266. <i:InvokeCommandAction Command="{Binding LoadedCommand}" PassEventArgsToCommand="True">
  267. <i:InvokeCommandAction.CommandParameter>
  268. <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
  269. <MultiBinding.Bindings>
  270. <Binding ElementName="BtnFirstPage" />
  271. <Binding ElementName="BtnPrePage" />
  272. <Binding ElementName="BtnNextPage" />
  273. <Binding ElementName="BtnLastPage" />
  274. </MultiBinding.Bindings>
  275. </MultiBinding>
  276. </i:InvokeCommandAction.CommandParameter>
  277. </i:InvokeCommandAction>
  278. </i:EventTrigger>
  279. </i:Interaction.Triggers>-->
  280. </UserControl>