BottomToolContent.xaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <UserControl
  2. x:Class="PDF_Office.Views.BottomToolContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:local="clr-namespace:PDF_Office.Views"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:prism="http://prismlibrary.com/"
  11. xmlns:sys="clr-namespace:System;assembly=System"
  12. xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
  13. d:DataContext="{d:DesignInstance Type=viewmodels:BottomToolContentViewModel}"
  14. d:DesignHeight="450"
  15. d:DesignWidth="1280"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. BorderBrush="{StaticResource color.sys.layout.divider}"
  18. BorderThickness="0,1,0,0"
  19. mc:Ignorable="d">
  20. <UserControl.Resources />
  21. <Grid Height="32" Background="{StaticResource color.sys.layout.mg}">
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="*" />
  24. <ColumnDefinition Width="auto" MinWidth="{Binding ElementName=StkPnlCenter, Path=ActualWidth}" />
  25. <ColumnDefinition MinWidth="{Binding ElementName=StkPnlRight, Path=ActualWidth}" />
  26. </Grid.ColumnDefinitions>
  27. <StackPanel
  28. Name="StkPnlCenter"
  29. Grid.Column="1"
  30. HorizontalAlignment="Center"
  31. Orientation="Horizontal">
  32. <Button
  33. Width="24"
  34. Height="24"
  35. Margin="4"
  36. Command="{Binding FirstPageCommand}">
  37. <Path
  38. HorizontalAlignment="Center"
  39. Data="M5.01864718,2 L5.01864718,14 L4,14 L4,2 L5.01864718,2 Z M11.2797077,2.64644661 L12,3.35355339 L7.2668015,8 L12,12.6464466 L11.2797077,13.3535534 L5.82632562,8 L11.2797077,2.64644661 Z"
  40. Fill="Black">
  41. <Path.RenderTransform>
  42. <TransformGroup>
  43. <TranslateTransform X="-2" />
  44. </TransformGroup>
  45. </Path.RenderTransform>
  46. </Path>
  47. </Button>
  48. <Button
  49. Width="24"
  50. Height="24"
  51. Margin="4"
  52. Command="{Binding PrePageCommand}">
  53. <Polygon Fill="Black" Points="14.25 5.45223214 13.5232733 4.75 8.25 9.84553571 2.97672673 4.75 2.25 5.45223214 8.25 11.25">
  54. <Polygon.RenderTransform>
  55. <TransformGroup>
  56. <TranslateTransform X="8.250000" Y="8.000000" />
  57. <ScaleTransform ScaleX="-1" ScaleY="1" />
  58. <RotateTransform Angle="90" />
  59. <TranslateTransform X="22.250000" Y="23.000000" />
  60. </TransformGroup>
  61. </Polygon.RenderTransform>
  62. </Polygon>
  63. </Button>
  64. <cus:TextBoxEx
  65. Width="57"
  66. Height="24"
  67. VerticalAlignment="Center"
  68. VerticalContentAlignment="Center"
  69. CornerRadius="4"
  70. FontSize="12"
  71. InputMethod.IsInputMethodEnabled="False"
  72. ShowClose="False"
  73. Text="{Binding CurrentPage}">
  74. <i:Interaction.Triggers>
  75. <i:EventTrigger EventName="KeyDown">
  76. <i:InvokeCommandAction Command="{Binding PageTextKeyDownCommand}" PassEventArgsToCommand="True" />
  77. </i:EventTrigger>
  78. <i:EventTrigger EventName="PreviewKeyDown">
  79. <i:InvokeCommandAction Command="{Binding PageTextPreviewKeyDownCommand}" PassEventArgsToCommand="True" />
  80. </i:EventTrigger>
  81. </i:Interaction.Triggers>
  82. </cus:TextBoxEx>
  83. <TextBlock
  84. Margin="8,0"
  85. VerticalAlignment="Center"
  86. Text="/" />
  87. <TextBlock
  88. MinWidth="13"
  89. VerticalAlignment="Center"
  90. Text="{Binding PageCount, StringFormat={}{0}}" />
  91. <Button
  92. Width="24"
  93. Height="24"
  94. Margin="4"
  95. Command="{Binding NextPageCommand}">
  96. <Polygon Fill="Black" Points="14.25 5.45223214 13.5232733 4.75 8.25 9.84553571 2.97672673 4.75 2.25 5.45223214 8.25 11.25">
  97. <Polygon.RenderTransform>
  98. <TransformGroup>
  99. <TranslateTransform X="8.000000" Y="8.000000" />
  100. <ScaleTransform ScaleX="-1" ScaleY="1" />
  101. <RotateTransform Angle="-90" />
  102. <TranslateTransform X="-8.000000" Y="-10.000000" />
  103. </TransformGroup>
  104. </Polygon.RenderTransform>
  105. </Polygon>
  106. </Button>
  107. <Button
  108. Width="24"
  109. Height="24"
  110. Margin="4"
  111. Command="{Binding LastPageCommand}">
  112. <Path Data="M12.0252351,2 L12.0252351,14 L11.0252351,14 L11.0252351,2 L12.0252351,2 Z M4.6892629,2.64644661 L9.90771909,8 L4.6892629,13.3535534 L4,12.6464466 L8.52929737,8 L4,3.35355339 L4.6892629,2.64644661 Z" Fill="Black">
  113. <Path.RenderTransform>
  114. <TransformGroup>
  115. <TranslateTransform X="-3" />
  116. </TransformGroup>
  117. </Path.RenderTransform>
  118. </Path>
  119. </Button>
  120. <Separator Margin="4,0,0,0" Style="{StaticResource VerticalSeparatorStyle}" />
  121. <Button
  122. Width="24"
  123. Height="24"
  124. Margin="8,0"
  125. Command="{Binding PreViewCommand}"
  126. IsEnabled="{Binding IsPreEnable}">
  127. <Path
  128. Width="16"
  129. Height="16"
  130. Data="M2.56067 7.28028L5.7803 4.06066L4.71964 3L0.21967 7.49997C-0.0732233 7.79286 -0.0732233 8.26774 0.21967 8.56063L4.71964 13.0606L5.7803 11.9999L2.56065 8.78028L15.75 8.78029V7.28029L2.56067 7.28028Z"
  131. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  132. </Button>
  133. <Button
  134. Width="24"
  135. Height="24"
  136. Command="{Binding NextViewCommnad}"
  137. IsEnabled="{Binding IsNextEnable}">
  138. <Path
  139. Width="16"
  140. Height="16"
  141. Data="M13.1893 8.78026L9.9697 11.9999L11.0304 13.0605L15.5303 8.56058C15.8232 8.26768 15.8232 7.79281 15.5303 7.49992L11.0304 2.99995L9.9697 4.06061L13.1894 7.28026L0 7.28026V8.78026L13.1893 8.78026Z"
  142. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  143. </Button>
  144. </StackPanel>
  145. <StackPanel
  146. x:Name="StkPnlRight"
  147. Grid.Column="2"
  148. HorizontalAlignment="Right"
  149. IsEnabled="{Binding RightPanelEnable}"
  150. Orientation="Horizontal">
  151. <ToggleButton
  152. Width="24"
  153. Height="24"
  154. Margin="4"
  155. Command="{Binding SetViewModeCommand}"
  156. IsChecked="{Binding IsContinue}"
  157. Style="{StaticResource SubToolbarTgb}">
  158. <Grid>
  159. <Polygon Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ToggleButton}, Path=Foreground}" Points="2 0 2 6 14 6 14 0 15 0 15 7 1 7 1 0" />
  160. <Path Data="M10.807106,9 L15,13.3928931 L15,16 L14,16 L14,14 L9.999999,14 L9.999,10 L2,10 L2,16 L1,16 L1,9 L10.807106,9 Z M13.237,13 L10.999,10.64 L10.999,13 L13.237,13 Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ToggleButton}, Path=Foreground}" />
  161. </Grid>
  162. </ToggleButton>
  163. <Separator
  164. Width="1"
  165. Height="10"
  166. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  167. <RadioButton
  168. Width="24"
  169. Height="24"
  170. Margin="4"
  171. Command="{Binding SetViewModeCommand}"
  172. IsChecked="{Binding IsSingleView}"
  173. Style="{StaticResource StateBarRbt}">
  174. <Path Data="M9.80710597,0 L14,4.39289312 L14,16 L2,16 L2,0 L9.80710597,0 Z M8.999,1 L3,1 L3,15 L13,15 L13,4.999 L8.999999,5 L8.999,1 Z M12.236,3.999 L9.999,1.64 L9.999,4 L12.236,3.999 Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Foreground}" />
  175. </RadioButton>
  176. <RadioButton
  177. Width="24"
  178. Height="24"
  179. Margin="4"
  180. Command="{Binding SetViewModeCommand}"
  181. Cursor="Hand"
  182. IsChecked="{Binding IsDoubleView}"
  183. Style="{StaticResource StateBarRbt}">
  184. <Path Data="M0,15 L0,1 L11.807106,1 L16,5.39289312 L16,15 L0,15 Z M7.5,2 L1,2 L1,14 L7.5,14 L7.5,2 Z M10.999,2 L8.5,2 L8.5,14 L15,14 L15,5.999 L10.999999,6 L10.999,2 Z M11.999,2.64 L11.999,5 L14.236,4.999 L11.999,2.64 Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Foreground}" />
  185. </RadioButton>
  186. <RadioButton
  187. Width="24"
  188. Height="24"
  189. Margin="4"
  190. Command="{Binding SetViewModeCommand}"
  191. IsChecked="{Binding IsBookMode}"
  192. Style="{StaticResource StateBarRbt}">
  193. <Path Data="M7,11 L7,16 L6,16 L6,12 L1,12 L1,16 L0,16 L0,11 L7,11 Z M16,11 L16,16 L15,16 L15,12 L10,12 L10,16 L9,16 L9,11 L16,11 Z M3.80710597,0 L7,3.39289312 L7,9 L0,9 L0,0 L3.80710597,0 Z M2.999,1 L1,1 L1,8 L6,8 L6,3.999 L2.999999,4 L2.999,1 Z M3.999,1.652 L3.999,3 L5.251,2.999 L3.999,1.652 Z" Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=RadioButton}, Path=Foreground}" />
  194. </RadioButton>
  195. <Separator
  196. Width="1"
  197. Height="10"
  198. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  199. <ToggleButton
  200. Name="TbtnIsViewPanelOpen"
  201. Width="24"
  202. Height="24"
  203. Margin="4"
  204. Command="{Binding ShowViewModularCommand}"
  205. IsChecked="{Binding IsShowViewModular}"
  206. Style="{StaticResource SubToolbarTgb}">
  207. <Path Data="M1.5 13V3H7.25V13H1.5ZM8.75 13H14.5V3H8.75V13ZM0 2.5C0 1.94772 0.447715 1.5 1 1.5H15C15.5523 1.5 16 1.94772 16 2.5V13.5C16 14.0523 15.5523 14.5 15 14.5H1C0.447715 14.5 0 14.0523 0 13.5V2.5ZM3 6.25H6V7.75H3V6.25ZM6 9.25H3V10.75H6V9.25Z" Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  208. </ToggleButton>
  209. <StackPanel
  210. Height="16"
  211. FocusVisualStyle="{x:Null}"
  212. Orientation="Horizontal">
  213. <Grid>
  214. <ComboBox
  215. Width="72"
  216. Background="White"
  217. FocusVisualStyle="{x:Null}"
  218. MaxDropDownHeight="510"
  219. SelectedIndex="{Binding SelectedIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  220. <i:Interaction.Triggers>
  221. <i:EventTrigger EventName="SelectionChanged">
  222. <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}" PassEventArgsToCommand="True" />
  223. </i:EventTrigger>
  224. </i:Interaction.Triggers>
  225. <ComboBoxItem x:Name="ActualSize" Style="{StaticResource ZoomComboxItemStyle}">
  226. <StackPanel Orientation="Horizontal">
  227. <Border x:Name="ActualSizeBorder" Margin="10,0,12,0">
  228. <!--<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" />-->
  229. </Border>
  230. <TextBlock
  231. x:Name="ActualSizeText"
  232. VerticalAlignment="Center"
  233. Text="Actual Size" />
  234. </StackPanel>
  235. </ComboBoxItem>
  236. <ComboBoxItem x:Name="FitWidth" Style="{StaticResource ZoomComboxItemStyle}">
  237. <StackPanel Orientation="Horizontal ">
  238. <Border Name="FitWidthBorder" Margin="10,0,12,0">
  239. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/fitwidth.png" />-->
  240. </Border>
  241. <TextBlock x:Name="FitWidthText" Text="Fit Width" />
  242. </StackPanel>
  243. </ComboBoxItem>
  244. <ComboBoxItem x:Name="FitHeight" Style="{StaticResource ZoomComboxItemStyle}">
  245. <StackPanel Orientation="Horizontal">
  246. <Border Name="FitHeightBorder" Margin="10,0,12,0">
  247. <!--<Image Width="16" Height="16" Source="../Resources/Image/bottombar/adaptationHeight.png" />-->
  248. </Border>
  249. <TextBlock x:Name="FitHeightText" Text="Fit Height" />
  250. </StackPanel>
  251. </ComboBoxItem>
  252. <Separator
  253. Height="1"
  254. BorderBrush="#33000000"
  255. BorderThickness="1"
  256. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  257. <ComboBoxItem
  258. Padding="40,0,0,0"
  259. Content="10%"
  260. Style="{StaticResource ZoomComboxItemStyle}"
  261. Tag="10" />
  262. <ComboBoxItem
  263. Padding="40,0,0,0"
  264. Content="25%"
  265. Style="{StaticResource ZoomComboxItemStyle}"
  266. Tag="25" />
  267. <ComboBoxItem
  268. Padding="40,0,0,0"
  269. Content="50%"
  270. Style="{StaticResource ZoomComboxItemStyle}"
  271. Tag="50" />
  272. <ComboBoxItem
  273. Padding="40,0,0,0"
  274. Content="100%"
  275. Style="{StaticResource ZoomComboxItemStyle}"
  276. Tag="100" />
  277. <ComboBoxItem
  278. Padding="40,0,0,0"
  279. Content="150%"
  280. Style="{StaticResource ZoomComboxItemStyle}"
  281. Tag="150" />
  282. <ComboBoxItem
  283. Padding="40,0,0,0"
  284. Content="200%"
  285. Style="{StaticResource ZoomComboxItemStyle}"
  286. Tag="200" />
  287. <ComboBoxItem
  288. Padding="40,0,0,0"
  289. Content="300%"
  290. Style="{StaticResource ZoomComboxItemStyle}"
  291. Tag="300" />
  292. <ComboBoxItem
  293. Padding="40,0,0,0"
  294. Content="400%"
  295. Style="{StaticResource ZoomComboxItemStyle}"
  296. Tag="400" />
  297. <ComboBoxItem
  298. Padding="40,0,0,0"
  299. Content="500%"
  300. Style="{StaticResource ZoomComboxItemStyle}"
  301. Tag="500" />
  302. <ComboBoxItem
  303. Padding="40,0,0,0"
  304. Content="1000%"
  305. Style="{StaticResource ZoomComboxItemStyle}"
  306. Tag="1000" />
  307. </ComboBox>
  308. <TextBlock
  309. Width="45"
  310. Height="14"
  311. Margin="4,0,0,0"
  312. HorizontalAlignment="Left"
  313. Background="White"
  314. Text="{Binding CurrentZoom, StringFormat={}{0}%}" />
  315. </Grid>
  316. <StackPanel Orientation="Horizontal">
  317. <Button
  318. Width="14"
  319. Height="16"
  320. VerticalContentAlignment="Center"
  321. Command="{Binding ZoomInCommand}"
  322. Content="+" />
  323. <Button
  324. Width="14"
  325. Height="16"
  326. VerticalContentAlignment="Center"
  327. Command="{Binding ZoomOutCommand}"
  328. Content="-" />
  329. </StackPanel>
  330. </StackPanel>
  331. </StackPanel>
  332. </Grid>
  333. </UserControl>