PageContent.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <UserControl
  2. x:Class="PDF_Office.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_Office.DataConvert"
  6. xmlns:DataConvert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:ViewModular="clr-namespace:PDF_Office.ViewModels.PropertyPanel.ViewModular"
  8. xmlns:customControl="clr-namespace:PDF_Office.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_Office.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="400"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. Background="#FFFFFF"
  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="M15.905 6L10.2268 11.4585C9.9244 11.7492 9.9244 12.2205 10.2268 12.5112L15.905 17.9697L17 16.9171L11.8693 11.9849L17 7.05266L15.905 6ZM7 6.03026V18H8.5V6.03026H7Z" />
  27. <PathGeometry x:Key="Ic_PrePageButtonPath" Figures="M8.72679 11.4723L14.405 6L15.5 7.05533L10.3693 12L15.5 16.9447L14.405 18L8.72679 12.5277C8.4244 12.2362 8.4244 11.7638 8.72679 11.4723Z" />
  28. <PathGeometry x:Key="Ic_NextPageButtonPath" Figures="M15.2732 11.4723L9.59502 6L8.5 7.05533L13.6307 12L8.5 16.9447L9.59502 18L15.2732 12.5277C15.5756 12.2362 15.5756 11.7638 15.2732 11.4723Z" />
  29. <PathGeometry x:Key="Ic_LastPageButtonPath" Figures="M8.09502 6L13.7732 11.4585C14.0756 11.7492 14.0756 12.2205 13.7732 12.5112L8.09502 17.9697L7 16.9171L12.1307 11.9849L7 7.05266L8.09502 6ZM17 6.03026V18H15.5V6.03026H17Z" />
  30. </ResourceDictionary>
  31. </UserControl.Resources>
  32. <StackPanel Name="ParentPanel" Orientation="Horizontal">
  33. <Border
  34. Width="24"
  35. Height="24"
  36. Margin="16,0,5,0"
  37. BorderBrush="#DFE1E5"
  38. BorderThickness="1"
  39. CornerRadius="4">
  40. <customControl:PathButton
  41. x:Name="BtnFirstPage"
  42. Command="{Binding FirstPageCommand}"
  43. Icon="{StaticResource Ic_FirstPageButtonPath}"
  44. IconFill="#616469"
  45. IconMouseOver="{StaticResource Ic_FirstPageButtonPath}"
  46. IconMouseOverFill="#616469"
  47. IconPress="{StaticResource Ic_FirstPageButtonPath}"
  48. IconPressFill="#616469" />
  49. </Border>
  50. <Border
  51. Width="24"
  52. Height="24"
  53. Margin="0,0,5,0"
  54. BorderBrush="#DFE1E5"
  55. BorderThickness="1"
  56. CornerRadius="4">
  57. <customControl:PathButton
  58. x:Name="BtnPrePage"
  59. Command="{Binding PrePageCommand}"
  60. Icon="{StaticResource Ic_PrePageButtonPath}"
  61. IconFill="#616469"
  62. IconMouseOver="{StaticResource Ic_PrePageButtonPath}"
  63. IconMouseOverFill="#616469"
  64. IconPress="{StaticResource Ic_PrePageButtonPath}"
  65. IconPressFill="#616469" />
  66. </Border>
  67. <Border
  68. Width="60"
  69. Height="24"
  70. Margin="0,0,5,0"
  71. BorderBrush="#DFE1E5"
  72. BorderThickness="1"
  73. CornerRadius="4">
  74. <TextBox
  75. Width="60"
  76. VerticalAlignment="Center"
  77. Background="Transparent"
  78. BorderBrush="Transparent"
  79. BorderThickness="0"
  80. Foreground="#252629"
  81. Text="{Binding CurrentPage}"
  82. TextAlignment="Left">
  83. <i:Interaction.Triggers>
  84. <i:EventTrigger EventName="KeyDown">
  85. <i:InvokeCommandAction Command="{Binding PageTextKeyDownCommand}" PassEventArgsToCommand="True" />
  86. </i:EventTrigger>
  87. <i:EventTrigger EventName="PreviewKeyDown">
  88. <i:InvokeCommandAction Command="{Binding PageTextPreviewKeyDownCommand}" PassEventArgsToCommand="True" />
  89. </i:EventTrigger>
  90. </i:Interaction.Triggers>
  91. </TextBox>
  92. </Border>
  93. <TextBlock
  94. x:Name="TxtPageCount"
  95. Height="32"
  96. MinWidth="50"
  97. Margin="0,0,5,0"
  98. Padding="0,5.5,0,0"
  99. FontFamily="Segoe UI"
  100. FontSize="14"
  101. Foreground="#252629"
  102. Text="{Binding PageCount, StringFormat=/ {0}}"
  103. TextAlignment="Left" />
  104. <Border
  105. Width="24"
  106. Height="24"
  107. Margin="0,0,5,0"
  108. BorderBrush="#DFE1E5"
  109. BorderThickness="1"
  110. CornerRadius="4">
  111. <customControl:PathButton
  112. x:Name="BtnNextPage"
  113. Command="{Binding NextPageCommand}"
  114. Icon="{StaticResource Ic_NextPageButtonPath}"
  115. IconFill="#616469"
  116. IconMouseOver="{StaticResource Ic_NextPageButtonPath}"
  117. IconMouseOverFill="#616469"
  118. IconPress="{StaticResource Ic_NextPageButtonPath}"
  119. IconPressFill="#616469" />
  120. </Border>
  121. <Border
  122. Width="24"
  123. Height="24"
  124. Margin="0,0,5,0"
  125. BorderBrush="#DFE1E5"
  126. BorderThickness="1"
  127. CornerRadius="4">
  128. <customControl:PathButton
  129. x:Name="BtnLastPage"
  130. Command="{Binding LastPageCommand}"
  131. Icon="{StaticResource Ic_LastPageButtonPath}"
  132. IconFill="#616469"
  133. IconMouseOver="{StaticResource Ic_LastPageButtonPath}"
  134. IconMouseOverFill="#616469"
  135. IconPress="{StaticResource Ic_LastPageButtonPath}"
  136. IconPressFill="#616469" />
  137. </Border>
  138. <Border
  139. Width="120"
  140. Height="24"
  141. Margin="0,0,16,0"
  142. BorderBrush="#E2E3E6"
  143. BorderThickness="0">
  144. <Grid>
  145. <ComboBox
  146. Name="ZoomBox"
  147. Background="Transparent"
  148. BorderBrush="#FFE2E3E6"
  149. BorderThickness="1"
  150. MaxDropDownHeight="510"
  151. SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  152. <ComboBoxItem x:Name="ActualSize" Style="{StaticResource ZoomComboxItemStyle}">
  153. <StackPanel Orientation="Horizontal">
  154. <Border x:Name="ActualSizeBorder" Margin="7,0,12,0">
  155. <!--<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" />-->
  156. </Border>
  157. <TextBlock
  158. x:Name="ActualSizeText"
  159. VerticalAlignment="Center"
  160. Text="Actual Size" />
  161. </StackPanel>
  162. </ComboBoxItem>
  163. <ComboBoxItem x:Name="FitWidth" Style="{StaticResource ZoomComboxItemStyle}">
  164. <StackPanel Orientation="Horizontal ">
  165. <Border Name="FitWidthBorder" Margin="7,0,12,0">
  166. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/fitwidth.png" />-->
  167. </Border>
  168. <TextBlock x:Name="FitWidthText" Text="Fit Width" />
  169. </StackPanel>
  170. </ComboBoxItem>
  171. <ComboBoxItem x:Name="FitHeight" Style="{StaticResource ZoomComboxItemStyle}">
  172. <StackPanel Orientation="Horizontal">
  173. <Border Name="FitHeightBorder" Margin="7,0,12,0">
  174. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/adaptationHeight.png" />-->
  175. </Border>
  176. <TextBlock x:Name="FitHeightText" Text="Fit Height" />
  177. </StackPanel>
  178. </ComboBoxItem>
  179. <Separator
  180. Height="1"
  181. BorderBrush="#33000000"
  182. BorderThickness="1"
  183. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  184. <ComboBoxItem
  185. Padding="30,0,0,0"
  186. Content="10%"
  187. Style="{StaticResource ZoomComboxItemStyle}"
  188. Tag="10" />
  189. <ComboBoxItem
  190. Padding="30,0,0,0"
  191. Content="25%"
  192. Style="{StaticResource ZoomComboxItemStyle}"
  193. Tag="25" />
  194. <ComboBoxItem
  195. Padding="30,0,0,0"
  196. Content="50%"
  197. Style="{StaticResource ZoomComboxItemStyle}"
  198. Tag="50" />
  199. <ComboBoxItem
  200. Padding="30,0,0,0"
  201. Content="100%"
  202. Style="{StaticResource ZoomComboxItemStyle}"
  203. Tag="100" />
  204. <ComboBoxItem
  205. Padding="30,0,0,0"
  206. Content="150%"
  207. Style="{StaticResource ZoomComboxItemStyle}"
  208. Tag="150" />
  209. <ComboBoxItem
  210. Padding="30,0,0,0"
  211. Content="200%"
  212. Style="{StaticResource ZoomComboxItemStyle}"
  213. Tag="200" />
  214. <ComboBoxItem
  215. Padding="30,0,0,0"
  216. Content="300%"
  217. Style="{StaticResource ZoomComboxItemStyle}"
  218. Tag="300" />
  219. <ComboBoxItem
  220. Padding="30,0,0,0"
  221. Content="400%"
  222. Style="{StaticResource ZoomComboxItemStyle}"
  223. Tag="400" />
  224. <ComboBoxItem
  225. Padding="30,0,0,0"
  226. Content="500%"
  227. Style="{StaticResource ZoomComboxItemStyle}"
  228. Tag="500" />
  229. <ComboBoxItem
  230. Padding="30,0,0,0"
  231. Content="1000%"
  232. Style="{StaticResource ZoomComboxItemStyle}"
  233. Tag="1000" />
  234. <i:Interaction.Triggers>
  235. <i:EventTrigger EventName="SelectionChanged">
  236. <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True" />
  237. </i:EventTrigger>
  238. </i:Interaction.Triggers>
  239. </ComboBox>
  240. <TextBox
  241. Name="TxtZoom"
  242. Height="20"
  243. Margin="2,0,25,0"
  244. Padding="10,0,0,0"
  245. VerticalAlignment="Center"
  246. Background="White"
  247. BorderThickness="0"
  248. FontFamily="Segoe UI"
  249. FontSize="14"
  250. IsReadOnly="True"
  251. Text="{Binding CurrentZoom, StringFormat={}{0}%}"
  252. TextAlignment="Left" />
  253. </Grid>
  254. </Border>
  255. </StackPanel>
  256. <!--<i:Interaction.Triggers>
  257. <i:EventTrigger EventName="Loaded">
  258. <i:InvokeCommandAction Command="{Binding LoadedCommand}" PassEventArgsToCommand="True">
  259. <i:InvokeCommandAction.CommandParameter>
  260. <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
  261. <MultiBinding.Bindings>
  262. <Binding ElementName="BtnFirstPage" />
  263. <Binding ElementName="BtnPrePage" />
  264. <Binding ElementName="BtnNextPage" />
  265. <Binding ElementName="BtnLastPage" />
  266. </MultiBinding.Bindings>
  267. </MultiBinding>
  268. </i:InvokeCommandAction.CommandParameter>
  269. </i:InvokeCommandAction>
  270. </i:EventTrigger>
  271. </i:Interaction.Triggers>-->
  272. </UserControl>