PageContent.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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="M16.4056 7.40441L11.8105 11.9995L16.4056 16.5945L15.3449 17.6552L10.2196 12.5298C9.92666 12.2369 9.92666 11.762 10.2196 11.4691L15.3449 6.34375L16.4056 7.40441ZM7.25 6.5V17.5H8.75V6.5H7.25Z" />
  27. <PathGeometry x:Key="Ic_PrePageButtonPath" Figures="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" />
  28. <PathGeometry x:Key="Ic_NextPageButtonPath" Figures="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" />
  29. <PathGeometry x:Key="Ic_LastPageButtonPath" Figures="M7.24968 7.40441L11.8447 11.9995L7.24968 16.5945L8.31034 17.6552L13.4357 12.5298C13.7286 12.2369 13.7286 11.762 13.4357 11.4691L8.31034 6.34375L7.24968 7.40441ZM16.4053 6.5V17.5H14.9053V6.5H16.4053Z" />
  30. </ResourceDictionary>
  31. </UserControl.Resources>
  32. <Border
  33. Background="{StaticResource color.sys.layout.anti}"
  34. CornerRadius="4"
  35. Effect="{StaticResource shadow.neutral.m}">
  36. <StackPanel Name="ParentPanel" Orientation="Horizontal">
  37. <StackPanel
  38. MinWidth="219"
  39. Margin="16,0,16,0"
  40. Orientation="Horizontal">
  41. <Border
  42. Width="24"
  43. Height="24"
  44. Margin="0,0,8,0"
  45. BorderBrush="#DFE1E5"
  46. BorderThickness="1"
  47. CornerRadius="4">
  48. <customControl:PathButton
  49. x:Name="BtnFirstPage"
  50. Command="{Binding FirstPageCommand}"
  51. Icon="{StaticResource Ic_FirstPageButtonPath}"
  52. IconFill="#616469"
  53. IconMouseOver="{StaticResource Ic_FirstPageButtonPath}"
  54. IconMouseOverFill="#616469"
  55. IconPress="{StaticResource Ic_FirstPageButtonPath}"
  56. IconPressFill="#616469" />
  57. </Border>
  58. <Border
  59. Width="24"
  60. Height="24"
  61. Margin="0,0,8,0"
  62. BorderBrush="#DFE1E5"
  63. BorderThickness="1"
  64. CornerRadius="4">
  65. <customControl:PathButton
  66. x:Name="BtnPrePage"
  67. Command="{Binding PrePageCommand}"
  68. Icon="{StaticResource Ic_PrePageButtonPath}"
  69. IconFill="#616469"
  70. IconMouseOver="{StaticResource Ic_PrePageButtonPath}"
  71. IconMouseOverFill="#616469"
  72. IconPress="{StaticResource Ic_PrePageButtonPath}"
  73. IconPressFill="#616469" />
  74. </Border>
  75. <Border
  76. Width="57"
  77. Height="24"
  78. BorderBrush="#DFE1E5"
  79. BorderThickness="1"
  80. CornerRadius="4">
  81. <TextBox
  82. Width="54"
  83. VerticalAlignment="Center"
  84. Background="Transparent"
  85. BorderBrush="Transparent"
  86. BorderThickness="0"
  87. Foreground="#252629"
  88. InputMethod.IsInputMethodEnabled="False"
  89. Text="{Binding CurrentPage}"
  90. TextAlignment="Left">
  91. <i:Interaction.Triggers>
  92. <i:EventTrigger EventName="KeyDown">
  93. <i:InvokeCommandAction Command="{Binding PageTextKeyDownCommand}" PassEventArgsToCommand="True" />
  94. </i:EventTrigger>
  95. <i:EventTrigger EventName="PreviewKeyDown">
  96. <i:InvokeCommandAction Command="{Binding PageTextPreviewKeyDownCommand}" PassEventArgsToCommand="True" />
  97. </i:EventTrigger>
  98. <i:EventTrigger EventName="LostFocus">
  99. <i:InvokeCommandAction Command="{Binding PageTextFocusableChangedCommand}" PassEventArgsToCommand="True" />
  100. </i:EventTrigger>
  101. </i:Interaction.Triggers>
  102. </TextBox>
  103. </Border>
  104. <TextBlock
  105. x:Name="TxtPageCount"
  106. Height="32"
  107. MinWidth="34"
  108. Margin="8,0,0,0"
  109. Padding="0,5.5,0,0"
  110. FontFamily="Segoe UI"
  111. FontSize="14"
  112. Foreground="#252629"
  113. Text="{Binding PageCount, StringFormat=/ {0}}"
  114. TextAlignment="Left" />
  115. <Border
  116. Width="24"
  117. Height="24"
  118. Margin="0,0,8,0"
  119. BorderBrush="#DFE1E5"
  120. BorderThickness="1"
  121. CornerRadius="4">
  122. <customControl:PathButton
  123. x:Name="BtnNextPage"
  124. Command="{Binding NextPageCommand}"
  125. Icon="{StaticResource Ic_NextPageButtonPath}"
  126. IconFill="#616469"
  127. IconMouseOver="{StaticResource Ic_NextPageButtonPath}"
  128. IconMouseOverFill="#616469"
  129. IconPress="{StaticResource Ic_NextPageButtonPath}"
  130. IconPressFill="#616469" />
  131. </Border>
  132. <Border
  133. Width="24"
  134. Height="24"
  135. Margin="0,0,8,0"
  136. BorderBrush="#DFE1E5"
  137. BorderThickness="1"
  138. CornerRadius="4">
  139. <customControl:PathButton
  140. x:Name="BtnLastPage"
  141. Command="{Binding LastPageCommand}"
  142. Icon="{StaticResource Ic_LastPageButtonPath}"
  143. IconFill="#616469"
  144. IconMouseOver="{StaticResource Ic_LastPageButtonPath}"
  145. IconMouseOverFill="#616469"
  146. IconPress="{StaticResource Ic_LastPageButtonPath}"
  147. IconPressFill="#616469" />
  148. </Border>
  149. </StackPanel>
  150. <Border
  151. Width="70"
  152. Height="24"
  153. Margin="0,0,11,0"
  154. BorderBrush="#E2E3E6"
  155. BorderThickness="0">
  156. <Grid>
  157. <ComboBox
  158. Name="ZoomBox"
  159. Background="Transparent"
  160. BorderBrush="Transparent"
  161. BorderThickness="0"
  162. MaxDropDownHeight="510"
  163. SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  164. <ComboBoxItem x:Name="ActualSize" Style="{StaticResource ZoomComboxItemStyle}">
  165. <StackPanel Orientation="Horizontal">
  166. <Border x:Name="ActualSizeBorder" Margin="7,0,12,0">
  167. <!--<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" />-->
  168. </Border>
  169. <TextBlock
  170. x:Name="ActualSizeText"
  171. VerticalAlignment="Center"
  172. Text="Actual Size" />
  173. </StackPanel>
  174. </ComboBoxItem>
  175. <ComboBoxItem x:Name="FitWidth" Style="{StaticResource ZoomComboxItemStyle}">
  176. <StackPanel Orientation="Horizontal ">
  177. <Border Name="FitWidthBorder" Margin="7,0,12,0">
  178. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/fitwidth.png" />-->
  179. </Border>
  180. <TextBlock x:Name="FitWidthText" Text="Fit Width" />
  181. </StackPanel>
  182. </ComboBoxItem>
  183. <ComboBoxItem x:Name="FitHeight" Style="{StaticResource ZoomComboxItemStyle}">
  184. <StackPanel Orientation="Horizontal">
  185. <Border Name="FitHeightBorder" Margin="7,0,12,0">
  186. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/adaptationHeight.png" />-->
  187. </Border>
  188. <TextBlock x:Name="FitHeightText" Text="Fit Height" />
  189. </StackPanel>
  190. </ComboBoxItem>
  191. <Separator
  192. Height="1"
  193. BorderBrush="#33000000"
  194. BorderThickness="1"
  195. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  196. <ComboBoxItem
  197. Padding="30,0,0,0"
  198. Content="10%"
  199. Style="{StaticResource ZoomComboxItemStyle}"
  200. Tag="10" />
  201. <ComboBoxItem
  202. Padding="30,0,0,0"
  203. Content="25%"
  204. Style="{StaticResource ZoomComboxItemStyle}"
  205. Tag="25" />
  206. <ComboBoxItem
  207. Padding="30,0,0,0"
  208. Content="50%"
  209. Style="{StaticResource ZoomComboxItemStyle}"
  210. Tag="50" />
  211. <ComboBoxItem
  212. Padding="30,0,0,0"
  213. Content="100%"
  214. Style="{StaticResource ZoomComboxItemStyle}"
  215. Tag="100" />
  216. <ComboBoxItem
  217. Padding="30,0,0,0"
  218. Content="150%"
  219. Style="{StaticResource ZoomComboxItemStyle}"
  220. Tag="150" />
  221. <ComboBoxItem
  222. Padding="30,0,0,0"
  223. Content="200%"
  224. Style="{StaticResource ZoomComboxItemStyle}"
  225. Tag="200" />
  226. <ComboBoxItem
  227. Padding="30,0,0,0"
  228. Content="300%"
  229. Style="{StaticResource ZoomComboxItemStyle}"
  230. Tag="300" />
  231. <ComboBoxItem
  232. Padding="30,0,0,0"
  233. Content="400%"
  234. Style="{StaticResource ZoomComboxItemStyle}"
  235. Tag="400" />
  236. <ComboBoxItem
  237. Padding="30,0,0,0"
  238. Content="500%"
  239. Style="{StaticResource ZoomComboxItemStyle}"
  240. Tag="500" />
  241. <ComboBoxItem
  242. Padding="30,0,0,0"
  243. Content="1000%"
  244. Style="{StaticResource ZoomComboxItemStyle}"
  245. Tag="1000" />
  246. <i:Interaction.Triggers>
  247. <i:EventTrigger EventName="SelectionChanged">
  248. <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True" />
  249. </i:EventTrigger>
  250. </i:Interaction.Triggers>
  251. </ComboBox>
  252. <TextBox
  253. Name="TxtZoom"
  254. Height="20"
  255. Margin="2,0,25,0"
  256. VerticalAlignment="Center"
  257. Background="White"
  258. BorderThickness="0"
  259. FontFamily="Segoe UI"
  260. FontSize="14"
  261. IsReadOnly="True"
  262. Text="{Binding CurrentZoom, StringFormat={}{0}%}"
  263. TextAlignment="Right" />
  264. </Grid>
  265. </Border>
  266. </StackPanel>
  267. </Border>
  268. <!--<i:Interaction.Triggers>
  269. <i:EventTrigger EventName="Loaded">
  270. <i:InvokeCommandAction Command="{Binding LoadedCommand}" PassEventArgsToCommand="True">
  271. <i:InvokeCommandAction.CommandParameter>
  272. <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
  273. <MultiBinding.Bindings>
  274. <Binding ElementName="BtnFirstPage" />
  275. <Binding ElementName="BtnPrePage" />
  276. <Binding ElementName="BtnNextPage" />
  277. <Binding ElementName="BtnLastPage" />
  278. </MultiBinding.Bindings>
  279. </MultiBinding>
  280. </i:InvokeCommandAction.CommandParameter>
  281. </i:InvokeCommandAction>
  282. </i:EventTrigger>
  283. </i:Interaction.Triggers>-->
  284. </UserControl>