ViewContent.xaml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. <UserControl
  2. x:Class="PDF_Master.Views.ViewContent"
  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:cus="clr-namespace:PDF_Master.CustomControl"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:helper="clr-namespace:PDF_Master.Helper"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:prism="http://prismlibrary.com/"
  12. xmlns:viewmodels="clr-namespace:PDF_Master.ViewModels"
  13. d:DataContext="{d:DesignInstance Type=viewmodels:ViewContentViewModel}"
  14. d:DesignHeight="450"
  15. d:DesignWidth="800"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. AllowDrop="True"
  18. DragEnter="UserControl_DragEnter"
  19. DragLeave="UserControl_DragLeave"
  20. DragOver="UserControl_DragOver"
  21. Drop="UserControl_Drop"
  22. IsVisibleChanged="UserControl_IsVisibleChanged"
  23. MouseDown="UserControl_MouseDown"
  24. Unloaded="UserControl_Unloaded"
  25. mc:Ignorable="d">
  26. <i:Interaction.Triggers>
  27. <i:EventTrigger EventName="Loaded">
  28. <prism:InvokeCommandAction Command="{Binding Load}" />
  29. </i:EventTrigger>
  30. <i:EventTrigger EventName="PreviewMouseDown">
  31. <prism:InvokeCommandAction Command="{Binding MouseDown}" />
  32. </i:EventTrigger>
  33. </i:Interaction.Triggers>
  34. <UserControl.Resources>
  35. <ResourceDictionary>
  36. <ResourceDictionary.MergedDictionaries>
  37. <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
  38. </ResourceDictionary.MergedDictionaries>
  39. <convert:InvertBoolConvert x:Key="UnBoolConvert" />
  40. <Style x:Key="MenuButtonStyle" TargetType="{x:Type Button}">
  41. <Setter Property="Width" Value="20" />
  42. <Setter Property="Height" Value="20" />
  43. </Style>
  44. <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
  45. <RoutedUICommand x:Key="CloseLeft" Text="CloseLeft" />
  46. <RoutedUICommand x:Key="CloseRight" Text="CloseRight" />
  47. <RoutedUICommand x:Key="AddTab" Text="AddTab" />
  48. <RoutedUICommand x:Key="CloseTab" Text="CloseTab" />
  49. </ResourceDictionary>
  50. </UserControl.Resources>
  51. <UserControl.InputBindings>
  52. <KeyBinding
  53. Key="F4"
  54. Command="{StaticResource CloseLeft}"
  55. Modifiers="Ctrl" />
  56. <KeyBinding
  57. Key="F4"
  58. Command="{StaticResource CloseRight}"
  59. Modifiers="Ctrl+Shift" />
  60. <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O" />
  61. <KeyBinding
  62. Key="T"
  63. Command="{StaticResource AddTab}"
  64. Modifiers="Ctrl" />
  65. <KeyBinding Command="{Binding SaveFile}" Gesture="Ctrl+S" />
  66. <KeyBinding Command="{Binding SaveAsFile}" Gesture="Ctrl+Shift+S" />
  67. <KeyBinding Command="{Binding CloseWindowCommand}" Gesture="Ctrl+Shift+W" />
  68. <KeyBinding
  69. Key="W"
  70. Command="{StaticResource CloseTab}"
  71. Modifiers="Ctrl" />
  72. <KeyBinding
  73. Key="P"
  74. Command="{Binding PrintCommand}"
  75. Modifiers="Ctrl" />
  76. <KeyBinding
  77. Key="S"
  78. Command="{Binding SaveFile}"
  79. Modifiers="Ctrl" />
  80. <KeyBinding
  81. Key="Z"
  82. Command="{Binding UndoCommand}"
  83. Modifiers="Ctrl" />
  84. <KeyBinding Command="{Binding RedoCommand}" Gesture="Ctrl+Shift+Z" />
  85. <KeyBinding
  86. Key="Up"
  87. Command="{x:Static helper:GlobalCommands.FirstPageCommand}"
  88. Modifiers="Ctrl" />
  89. <KeyBinding
  90. Key="Down"
  91. Command="{x:Static helper:GlobalCommands.LastPageCommand}"
  92. Modifiers="Ctrl" />
  93. <KeyBinding Key="Up" Command="{x:Static helper:GlobalCommands.UpCommand}" />
  94. <KeyBinding Key="Down" Command="{x:Static helper:GlobalCommands.DownCommand}" />
  95. <KeyBinding Key="Left" Command="{x:Static helper:GlobalCommands.PrePageCommand}" />
  96. <KeyBinding Key="PageUp" Command="{x:Static helper:GlobalCommands.PrePageCommand}" />
  97. <KeyBinding Key="PageDown" Command="{x:Static helper:GlobalCommands.NextPageCommand}" />
  98. <KeyBinding Key="Right" Command="{x:Static helper:GlobalCommands.NextPageCommand}" />
  99. <KeyBinding
  100. Key="B"
  101. Command="{x:Static helper:GlobalCommands.BookMarkCommand}"
  102. Modifiers="Ctrl" />
  103. <KeyBinding Key="F11" Command="{x:Static helper:GlobalCommands.FullWindowCommand}" />
  104. <KeyBinding
  105. Key="NumPad1"
  106. Command="{x:Static helper:GlobalCommands.SinglePageCommand}"
  107. Modifiers="Ctrl" />
  108. <KeyBinding
  109. Key="D1"
  110. Command="{x:Static helper:GlobalCommands.SinglePageCommand}"
  111. Modifiers="Ctrl" />
  112. <KeyBinding
  113. Key="NumPad2"
  114. Command="{x:Static helper:GlobalCommands.DoublePageCommand}"
  115. Modifiers="Ctrl" />
  116. <KeyBinding
  117. Key="D2"
  118. Command="{x:Static helper:GlobalCommands.DoublePageCommand}"
  119. Modifiers="Ctrl" />
  120. <KeyBinding
  121. Key="O"
  122. Command="{x:Static helper:GlobalCommands.RealSizeCommand}"
  123. Modifiers="Ctrl" />
  124. <KeyBinding
  125. Key="Add"
  126. Command="{x:Static helper:GlobalCommands.ZoomInCommand}"
  127. Modifiers="Ctrl" />
  128. <KeyBinding
  129. Key="OemPlus"
  130. Command="{x:Static helper:GlobalCommands.ZoomInCommand}"
  131. Modifiers="Ctrl" />
  132. <KeyBinding
  133. Key="Subtract"
  134. Command="{x:Static helper:GlobalCommands.ZoomOutPageCommand}"
  135. Modifiers="Ctrl" />
  136. <KeyBinding
  137. Key="OemMinus"
  138. Command="{x:Static helper:GlobalCommands.ZoomOutPageCommand}"
  139. Modifiers="Ctrl" />
  140. <KeyBinding
  141. Key="OemOpenBrackets"
  142. Command="{x:Static helper:GlobalCommands.PreViewCommand}"
  143. Modifiers="Ctrl" />
  144. <KeyBinding
  145. Key="OemCloseBrackets"
  146. Command="{x:Static helper:GlobalCommands.NextViewCommand}"
  147. Modifiers="Ctrl" />
  148. </UserControl.InputBindings>
  149. <UserControl.CommandBindings>
  150. <CommandBinding
  151. x:Name="CloseLeftCommand"
  152. Command="{StaticResource CloseLeft}"
  153. Executed="CloseLeftCommand_Executed" />
  154. <CommandBinding
  155. x:Name="AddTabCommand"
  156. Command="{StaticResource AddTab}"
  157. Executed="AddTabCommand_Executed" />
  158. <CommandBinding
  159. x:Name="CloseTabCommand"
  160. Command="{StaticResource CloseTab}"
  161. Executed="CloseTabCommand_Executed" />
  162. <CommandBinding
  163. x:Name="CloseRightCommand"
  164. Command="{StaticResource CloseRight}"
  165. Executed="CloseRightCommand_Executed" />
  166. </UserControl.CommandBindings>
  167. <Grid Background="{StaticResource color.sys.layout.mg}">
  168. <Grid.RowDefinitions>
  169. <RowDefinition Name="HeadRow" Height="40" />
  170. <RowDefinition Name="ToolRow" Height="40" />
  171. <RowDefinition Height="*" />
  172. <RowDefinition Height="32" />
  173. </Grid.RowDefinitions>
  174. <Grid Visibility="{Binding GridVisibility}">
  175. <!-- 左边菜单按钮 -->
  176. <StackPanel
  177. Margin="16,6,0,6"
  178. HorizontalAlignment="Left"
  179. Orientation="Horizontal"
  180. Visibility="{Binding IsReadMode}">
  181. <Button
  182. Name="BtnFile"
  183. Click="BtnFile_Click"
  184. Content="Files"
  185. Initialized="BtnFile_Initialized"
  186. Style="{StaticResource subToolBar}"
  187. ToolTip="{Binding T_File}">
  188. <Button.ContextMenu>
  189. <ContextMenu Name="FileMenu">
  190. <MenuItem
  191. Command="{Binding OpenFileCommand}"
  192. Header="Open Files"
  193. InputGestureText="Ctrl+O" />
  194. <MenuItem
  195. Name="MenuRecent"
  196. Header="Open Recent"
  197. Loaded="MenuRecent_Loaded">
  198. <Separator Name="Menu_Separator" Style="{StaticResource HorizontalSeparatorStyle}" />
  199. <MenuItem
  200. Name="MenuDeleteAll"
  201. Click="MenuDeleteAll_Click"
  202. Header="Delete All" />
  203. </MenuItem>
  204. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  205. <MenuItem Header="Create Files">
  206. <MenuItem Command="{Binding CreateFromFile}" Header="Create From File" />
  207. <MenuItem Command="{Binding CreateBlankFileCommand}" Header="Create Blank" />
  208. <MenuItem
  209. Command="{Binding mainViewModel.homeContentViewModel.CreateFromScanner}"
  210. CommandParameter="View"
  211. Header="Create Form Scanner" />
  212. </MenuItem>
  213. <MenuItem
  214. Command="{Binding mainViewModel.mainWindowViewModel.AddTab}"
  215. Header="New Tab"
  216. InputGestureText="Ctrl+T" />
  217. <MenuItem Command="{Binding MergeFileCommand}" Header="Merge PDF Files" />
  218. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  219. <MenuItem
  220. Command="{Binding SaveFile}"
  221. Header="Save"
  222. InputGestureText="Ctrl+S" />
  223. <MenuItem
  224. Command="{Binding SaveAsFile}"
  225. Header="Save As"
  226. InputGestureText="Ctrl+Shift+S" />
  227. <MenuItem
  228. Command="{Binding SaveAsFlattenCommand}"
  229. Header="Save as Flattened PDF"
  230. Visibility="Collapsed" />
  231. <MenuItem Command="{Binding CompressCommand}" Header="Compress" />
  232. <MenuItem Header="Convert To">
  233. <MenuItem
  234. Command="{Binding ConvertCommand}"
  235. CommandParameter="Word"
  236. Header="Word" />
  237. <MenuItem
  238. Command="{Binding ConvertCommand}"
  239. CommandParameter="Excel"
  240. Header="Excel" />
  241. <MenuItem
  242. Command="{Binding ConvertCommand}"
  243. CommandParameter="PPT"
  244. Header="PowerPoint" />
  245. <MenuItem
  246. Command="{Binding ConvertCommand}"
  247. CommandParameter="RTF"
  248. Header="RTF" />
  249. <MenuItem
  250. Command="{Binding ConvertCommand}"
  251. CommandParameter="HTML"
  252. Header="HTML" />
  253. <MenuItem
  254. Command="{Binding ConvertCommand}"
  255. CommandParameter="Text"
  256. Header="Text" />
  257. <MenuItem
  258. Command="{Binding ConvertCommand}"
  259. CommandParameter="CSV"
  260. Header="CSV" />
  261. <MenuItem
  262. Command="{Binding ConvertCommand}"
  263. CommandParameter="Image"
  264. Header="图片" />
  265. </MenuItem>
  266. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  267. <MenuItem
  268. Command="{Binding CloseWindowCommand}"
  269. Header="Close Window"
  270. InputGestureText="Ctrl+Shift+W" />
  271. <MenuItem
  272. Command="{Binding mainViewModel.CloseTab}"
  273. Header="Close Tab"
  274. InputGestureText="Ctrl+W" />
  275. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  276. <MenuItem Command="{Binding EncryptCommand}" Header="Set Passwords" />
  277. <MenuItem Command="{Binding DecryptCommand}" Header="Remove Security" />
  278. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  279. <MenuItem Command="{Binding ShowInFolderCommand}" Header="Show in Folder" />
  280. <MenuItem Command="{Binding PropertyCommand}" Header="Properties" />
  281. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  282. <MenuItem Command="{Binding ShareCommand}" Header="Share" />
  283. <MenuItem
  284. Command="{Binding PrintCommand}"
  285. Header="Print"
  286. InputGestureText="Ctrl+P" />
  287. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  288. <MenuItem Command="{Binding SettingsCommand}" Header="Settings" />
  289. <MenuItem Header="Help">
  290. <MenuItem
  291. Command="{Binding HelpCommand}"
  292. CommandParameter="Guid"
  293. Header="Quick Guide" />
  294. <MenuItem
  295. Command="{Binding HelpCommand}"
  296. CommandParameter="Online"
  297. Header="在线帮助"
  298. Visibility="Collapsed" />
  299. <MenuItem
  300. Command="{Binding HelpCommand}"
  301. CommandParameter="More"
  302. Header="More Products" />
  303. <MenuItem
  304. Command="{Binding HelpCommand}"
  305. CommandParameter="Template"
  306. Header="Free Template" />
  307. <MenuItem
  308. Command="{Binding HelpCommand}"
  309. CommandParameter="Blog"
  310. Header="订阅电子报"
  311. Visibility="Collapsed" />
  312. <MenuItem
  313. Command="{Binding HelpCommand}"
  314. CommandParameter="ComPDF"
  315. Header="Powered by ComPDFKit" />
  316. <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
  317. <MenuItem
  318. Command="{Binding HelpCommand}"
  319. CommandParameter="FeedBack"
  320. Header="Feedback" />
  321. </MenuItem>
  322. </ContextMenu>
  323. </Button.ContextMenu>
  324. </Button>
  325. <Separator
  326. Width="1"
  327. Height="12"
  328. Margin="8,0"
  329. Background="{StaticResource color.sys.layout.divider}"
  330. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  331. <Button
  332. Command="{Binding SaveFile}"
  333. IsEnabled="{Binding CanSave}"
  334. Style="{StaticResource subToolBar}"
  335. ToolTip="{Binding T_Save}">
  336. <Path
  337. Width="20"
  338. Height="20"
  339. Data="M16 16V6.82843L13.1716 4H12V8C12 9.10457 11.1046 10 10 10H7C5.89543 10 5 9.10457 5 8V4H4V16H16ZM7 4H10V8H7V4ZM13.1716 2H12H10H7H5H4C2.89543 2 2 2.89543 2 4V16C2 17.1046 2.89543 18 4 18H16C17.1046 18 18 17.1046 18 16V6.82843C18 6.29799 17.7893 5.78929 17.4142 5.41421L14.5858 2.58579C14.2107 2.21071 13.702 2 13.1716 2ZM9.25 5H7.75V7H9.25V5Z"
  340. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  341. </Button>
  342. <Button
  343. Margin="2,0"
  344. Command="{Binding UndoCommand}"
  345. IsEnabled="{Binding CanUndo}"
  346. Style="{StaticResource subToolBar}"
  347. ToolTip="{Binding T_Undo}">
  348. <Path
  349. Width="20"
  350. Height="20"
  351. Data="M5.75766 8.00008L6.70741 8.94982L5.2932 10.364L2.46477 7.53561C2.07424 7.14508 2.07424 6.51192 2.46477 6.1214L5.2932 3.29297L6.70741 4.70718L5.41451 6.00008H12.5001C15.5377 6.00008 18.0001 8.46251 18.0001 11.5001C18.0001 14.5376 15.5377 17.0001 12.5001 17.0001H3.00012V15.0001H12.5001C14.4331 15.0001 16.0001 13.4331 16.0001 11.5001C16.0001 9.56708 14.4331 8.00008 12.5001 8.00008H5.75766Z"
  352. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  353. </Button>
  354. <Button
  355. Command="{Binding RedoCommand}"
  356. IsEnabled="{Binding CanRedo}"
  357. Style="{StaticResource subToolBar}"
  358. ToolTip="{Binding T_Redo}">
  359. <Path
  360. Width="20"
  361. Height="20"
  362. Data="M14.2424 8.00006L13.2926 8.94982L14.7068 10.364L17.5352 7.53561C17.9258 7.14508 17.9258 6.51192 17.5352 6.1214L14.7068 3.29297L13.2926 4.70718L14.5855 6.00006H7.49969C4.46213 6.00006 1.9997 8.46249 1.9997 11.5001C1.9997 14.5376 4.46213 17.0001 7.4997 17.0001H16.9997V15.0001H7.4997C5.5667 15.0001 3.9997 13.4331 3.9997 11.5001C3.9997 9.56706 5.5667 8.00006 7.49969 8.00006H14.2424Z"
  363. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  364. </Button>
  365. <Button
  366. x:Name="ButLeft"
  367. Width="20"
  368. Height="40"
  369. HorizontalAlignment="Left"
  370. VerticalAlignment="Center"
  371. Click="ButLeft_Click"
  372. Content="&lt;"
  373. Style="{StaticResource subToolBar}"
  374. Visibility="Collapsed" />
  375. </StackPanel>
  376. <!-- 右边菜单按钮 -->
  377. <StackPanel
  378. Margin="0,6,16,6"
  379. HorizontalAlignment="Right"
  380. Orientation="Horizontal"
  381. Visibility="{Binding IsReadMode}">
  382. <Button
  383. x:Name="ButRight"
  384. Width="20"
  385. Height="40"
  386. HorizontalAlignment="Right"
  387. VerticalAlignment="Center"
  388. Click="ButRight_Click"
  389. Content="&gt;"
  390. Style="{StaticResource subToolBar}"
  391. Visibility="Collapsed" />
  392. <Button
  393. Command="{Binding PrintCommand}"
  394. Style="{StaticResource subToolBar}"
  395. ToolTip="{Binding T_Print}">
  396. <Path
  397. Width="20"
  398. Height="20"
  399. Data="M17 6.99999H14.8203C14.7973 7.00126 14.7741 7.0019 14.7508 7.0019L10.0008 7.00254L5.25081 7.00319C5.22047 7.00319 5.19038 7.00211 5.16058 6.99999H3C2.44772 6.99999 2 7.44771 2 7.99999V13.75C2 13.8881 2.11193 14 2.25 14H4V13.25C4 12.5596 4.55964 12 5.25 12H14.75C15.4404 12 16 12.5596 16 13.25V14H17.75C17.8881 14 18 13.8881 18 13.75V7.99999C18 7.44771 17.5523 6.99999 17 6.99999ZM16 16H17.75C18.9926 16 20 14.9926 20 13.75V7.99999C20 6.34314 18.6569 4.99999 17 4.99999H16.0005L16.0002 2.24837C16.0001 1.55801 15.4404 0.998442 14.75 0.998535L5.25 0.999822C4.55964 0.999916 4.00008 1.55964 4.00017 2.24999L4.00054 4.99999H3C1.34315 4.99999 0 6.34314 0 7.99999V13.75C0 14.9926 1.00736 16 2.25 16H4V17.75C4 18.4403 4.55964 19 5.25 19H14.75C15.4404 19 16 18.4403 16 17.75V16ZM6.00027 2.99972L6.00054 4.99999H14.0005L14.0003 2.99864L6.00027 2.99972ZM14 8.49999V10.5H16V8.49999H14ZM6 17V14H14V17H6Z"
  400. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  401. </Button>
  402. <Button
  403. Margin="2,0"
  404. Command="{Binding ShareCommand}"
  405. Style="{StaticResource subToolBar}"
  406. ToolTip="{Binding T_Share}">
  407. <Path
  408. Width="20"
  409. Height="20"
  410. Data="M15.0858 3.5H11.25V1.5H16.6395C17.667 1.5 18.5 2.33298 18.5 3.36051V8.75H16.5V4.91421L11.136 10.2782L9.72183 8.86396L15.0858 3.5ZM4.25 4C4.11193 4 4 4.11193 4 4.25V15.75C4 15.8881 4.11193 16 4.25 16H15.75C15.8881 16 16 15.8881 16 15.75V10.875H18V15.75C18 16.9926 16.9926 18 15.75 18H4.25C3.00736 18 2 16.9926 2 15.75V4.25C2 3.00736 3.00736 2 4.25 2H9.125V4H4.25Z"
  411. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  412. </Button>
  413. <ToggleButton
  414. Name="TbtnProperty"
  415. Width="28"
  416. Height="28"
  417. BorderThickness="0"
  418. Command="{Binding OpenPropertyCommand}"
  419. CommandParameter="{Binding ElementName=TbtnProperty, Path=IsChecked}"
  420. IsChecked="{Binding IsPropertyOpen, Mode=TwoWay}"
  421. IsEnabled="{Binding isInPageEdit, Converter={StaticResource UnBoolConvert}}"
  422. Style="{StaticResource SubToolbarTgb}"
  423. ToolTip="{Binding T_Properties}">
  424. <Path
  425. Width="20"
  426. Height="20"
  427. Data="M2 4V7H18V4H2ZM2 16V9H13V16H2ZM15 16H18V9H15V16ZM1.72101 2C0.770524 2 0 2.77052 0 3.72101V16.279C0 17.2295 0.770524 18 1.72101 18H18.279C19.2295 18 20 17.2295 20 16.279V3.72101C20 2.77052 19.2295 2 18.279 2H1.72101Z"
  428. Fill="{Binding ElementName=TbtnProperty, Path=Foreground}" />
  429. </ToggleButton>
  430. </StackPanel>
  431. <ScrollViewer
  432. x:Name="ScrViewTab"
  433. Margin="170,0,128,0"
  434. VerticalAlignment="Center"
  435. CanContentScroll="False"
  436. HorizontalScrollBarVisibility="Hidden"
  437. ScrollChanged="ScrViewTab_ScrollChanged"
  438. VerticalScrollBarVisibility="Disabled">
  439. <TabControl
  440. x:Name="ToolTabControl"
  441. Grid.Row="0"
  442. Grid.RowSpan="2"
  443. HorizontalAlignment="Center"
  444. VerticalAlignment="Top"
  445. BorderThickness="0"
  446. PreviewMouseLeftButtonDown="ToolTabControl_PreviewMouseLeftButtonDown"
  447. SelectedIndex="{Binding TabSelectedIndex, Mode=TwoWay}"
  448. Style="{StaticResource TabControlWithUnderLineStyle}"
  449. Visibility="{Binding IsReadMode}">
  450. <cus:IconAndTextTabItem
  451. x:Name="TabItemAnnotation"
  452. Header="{Binding T_Annotation}"
  453. Style="{StaticResource ToolbarTabs}">
  454. <Grid Grid.Row="1" Height="40" />
  455. </cus:IconAndTextTabItem>
  456. <cus:IconAndTextTabItem
  457. x:Name="TabItemPageEdit"
  458. Header="{Binding T_PageEdit}"
  459. Style="{StaticResource ToolbarTabs}" />
  460. <cus:IconAndTextTabItem
  461. x:Name="TabItemConvert"
  462. Header="{Binding T_Converter}"
  463. Style="{StaticResource ToolbarTabs}" />
  464. <cus:IconAndTextTabItem
  465. x:Name="TabItemScan"
  466. Header="扫描和OCR"
  467. Style="{StaticResource ToolbarTabs}"
  468. Visibility="Collapsed">
  469. <Grid Grid.Row="1" Height="40" />
  470. </cus:IconAndTextTabItem>
  471. <cus:IconAndTextTabItem
  472. x:Name="TabItemEdit"
  473. Height="40"
  474. Header="编辑"
  475. Style="{StaticResource ToolbarTabs}"
  476. Visibility="Collapsed">
  477. <Grid Grid.Row="1" Height="40" />
  478. </cus:IconAndTextTabItem>
  479. <cus:IconAndTextTabItem
  480. x:Name="TabItemForm"
  481. Height="40"
  482. Header="表单"
  483. Style="{StaticResource ToolbarTabs}"
  484. Visibility="Collapsed">
  485. <Grid Grid.Row="1" Height="40" />
  486. </cus:IconAndTextTabItem>
  487. <cus:IconAndTextTabItem
  488. x:Name="TabItemFill"
  489. Height="40"
  490. Header="{Binding T_FillSign}"
  491. Style="{StaticResource ToolbarTabs}">
  492. <Grid Grid.Row="1" Height="40" />
  493. </cus:IconAndTextTabItem>
  494. <cus:IconAndTextTabItem
  495. x:Name="TabItemTool"
  496. Height="40"
  497. Header="{Binding T_Tools}"
  498. Style="{StaticResource ToolbarTabs}">
  499. <Grid Grid.Row="1" Height="40" />
  500. </cus:IconAndTextTabItem>
  501. <i:Interaction.Triggers>
  502. <i:EventTrigger EventName="SelectionChanged">
  503. <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
  504. </i:EventTrigger>
  505. </i:Interaction.Triggers>
  506. </TabControl>
  507. </ScrollViewer>
  508. </Grid>
  509. <!-- 底部工具栏 -->
  510. <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
  511. <!-- 专门用来显示菜单二级工具栏 -->
  512. <!-- 调整工具栏的显示图层,方便阅读模式处理 -->
  513. <ContentControl
  514. Name="ContentToolsBar"
  515. Grid.Row="{Binding GridToolRow}"
  516. prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
  517. Visibility="{Binding ToolsBarContentVisible}" />
  518. <!--<ContentControl
  519. Name="ContentConverterBar"
  520. Grid.Row="{Binding GridToolRow}"
  521. prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
  522. Visibility="{Binding ConverterBarContentVisible}" />-->
  523. <ContentControl
  524. Name="TextEditContentBar"
  525. Grid.Row="{Binding GridToolRow}"
  526. prism:RegionManager.RegionName="{Binding TextEditContentRegionName}"
  527. Visibility="{Binding TextEditToolContentVisible}" />
  528. <Border
  529. Name="DocumentView"
  530. Grid.Row="2"
  531. BorderBrush="{StaticResource color.sys.layout.divider}"
  532. BorderThickness="0,1,0,0">
  533. <Grid Panel.ZIndex="0">
  534. <Grid.ColumnDefinitions>
  535. <ColumnDefinition
  536. x:Name="BOTACloumn"
  537. Width="{Binding BOTAWidth, Mode=TwoWay}"
  538. MinWidth="48"
  539. MaxWidth="472" />
  540. <ColumnDefinition Width="auto" />
  541. <ColumnDefinition
  542. Name="ViewerColumn"
  543. Width="*"
  544. MinWidth="200" />
  545. <ColumnDefinition Name="PropertyColumn" MinWidth="0">
  546. <ColumnDefinition.Style>
  547. <Style TargetType="{x:Type ColumnDefinition}">
  548. <Style.Triggers>
  549. <DataTrigger Binding="{Binding ElementName=TbtnProperty, Path=IsChecked}" Value="True">
  550. <Setter Property="Width" Value="260" />
  551. </DataTrigger>
  552. <DataTrigger Binding="{Binding ElementName=TbtnProperty, Path=IsChecked}" Value="False">
  553. <Setter Property="Width" Value="0" />
  554. </DataTrigger>
  555. </Style.Triggers>
  556. </Style>
  557. </ColumnDefinition.Style>
  558. </ColumnDefinition>
  559. </Grid.ColumnDefinitions>
  560. <ContentControl
  561. x:Name="BOTAContent"
  562. prism:RegionManager.RegionName="{Binding BOTARegionName}"
  563. SizeChanged="ContentControl_SizeChanged" />
  564. <GridSplitter
  565. Name="BOTASplitter"
  566. Grid.Column="1"
  567. Width="3"
  568. Background="Transparent"
  569. Cursor="SizeWE"
  570. FocusVisualStyle="{x:Null}"
  571. ResizeBehavior="PreviousAndNext"
  572. ShowsPreview="True" />
  573. <Grid Name="GridViewer" Grid.Column="2">
  574. <!-- 分屏功能需要的布局 -->
  575. <Grid.RowDefinitions>
  576. <RowDefinition Height="*" />
  577. <RowDefinition Height="auto" />
  578. <RowDefinition Name="RowRight" Height="0" />
  579. </Grid.RowDefinitions>
  580. <Grid.ColumnDefinitions>
  581. <ColumnDefinition Width="*" />
  582. <ColumnDefinition Name="ColumnSplitter" Width="auto" />
  583. <ColumnDefinition Name="ColumnBottom" Width="0" />
  584. </Grid.ColumnDefinitions>
  585. <ContentControl />
  586. <ContentControl
  587. x:Name="PDFViewerContent"
  588. HorizontalAlignment="Stretch"
  589. prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
  590. <ContentControl
  591. Name="SplitPDFViewer"
  592. Grid.Row="2"
  593. Grid.Column="2"
  594. prism:RegionManager.RegionName="{Binding SplitViewerRegionName}" />
  595. <GridSplitter
  596. Name="VerticalSplitter"
  597. Grid.Column="1"
  598. Width="12"
  599. Background="Gray"
  600. BorderThickness="0"
  601. ResizeBehavior="PreviousAndNext"
  602. ShowsPreview="True"
  603. Visibility="Collapsed" />
  604. <GridSplitter
  605. Name="HorizontalSplitter"
  606. Grid.Row="1"
  607. Height="12"
  608. HorizontalAlignment="Stretch"
  609. Background="Gray"
  610. BorderThickness="0"
  611. ResizeBehavior="PreviousAndNext"
  612. ShowsPreview="True"
  613. Visibility="Collapsed" />
  614. </Grid>
  615. <ContentControl
  616. x:Name="OCRViewerContent"
  617. Grid.ColumnSpan="3"
  618. HorizontalAlignment="Stretch"
  619. prism:RegionManager.RegionName="{Binding OCRViewerRegionName}"
  620. Visibility="{Binding OCRContentVisible}" />
  621. <ScrollViewer
  622. Name="Scroller"
  623. Grid.Column="4"
  624. Focusable="False"
  625. VerticalScrollBarVisibility="Auto">
  626. <ContentControl Height="{Binding ElementName=Scroller, Path=ViewportHeight}" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
  627. </ScrollViewer>
  628. <!-- 阅读页顶部提示栏区域 -->
  629. <ContentControl
  630. Grid.Column="2"
  631. Width="{Binding ElementName=PDFViewerContent, Path=Width}"
  632. VerticalAlignment="Top"
  633. prism:RegionManager.RegionName="{Binding TipContentRegionName}"
  634. Visibility="{Binding TipVisible}" />
  635. <!-- 阅读页顶部侧面提示区域 -->
  636. <ContentControl
  637. Grid.Column="2"
  638. Margin="16,8"
  639. HorizontalAlignment="Right"
  640. VerticalAlignment="Top"
  641. prism:RegionManager.RegionName="{Binding LeftTipContentRegionName}"
  642. Visibility="{Binding LeftTipVisible}" />
  643. <!-- 便签弹窗 -->
  644. <Canvas
  645. x:Name="CanvasNote"
  646. Grid.Column="2"
  647. Visibility="{Binding NotePopupVisible}">
  648. <StackPanel Canvas.Left="{Binding CanvasNoteLeft}" Canvas.Bottom="{Binding CanvasNoteBottom}">
  649. <!--<TextBlock Text="000" />-->
  650. <ContentControl prism:RegionManager.RegionName="{Binding NotePopupRegionName}" />
  651. </StackPanel>
  652. </Canvas>
  653. </Grid>
  654. </Border>
  655. <!-- 用于显示页面编辑、水印、背景、标记密文等功能的区域 -->
  656. <Border
  657. Grid.Row="{Binding GridToolRow}"
  658. Grid.RowSpan="{Binding GridToolRowSpan}"
  659. BorderBrush="{StaticResource color.sys.layout.divider}"
  660. BorderThickness="0,1"
  661. Visibility="{Binding ToolContentVisible}">
  662. <ContentControl Name="ContentTool" prism:RegionManager.RegionName="{Binding ToolContentRegionName}" />
  663. </Border>
  664. <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
  665. <Rectangle
  666. x:Name="RectangleBota"
  667. Grid.Row="2"
  668. Width="10"
  669. Height="{Binding ActualHeight, ElementName=GridViewer, Mode=OneWay}"
  670. Margin="0,0,0,0"
  671. HorizontalAlignment="Left"
  672. VerticalAlignment="Bottom"
  673. Fill="Red"
  674. Visibility="Collapsed" />
  675. <!-- 阅读模式下的页面控件 -->
  676. <Border
  677. x:Name="ReadModeContent"
  678. Grid.RowSpan="4"
  679. Height="44"
  680. Margin="0,0,0,16"
  681. HorizontalAlignment="Center"
  682. VerticalAlignment="Bottom"
  683. CornerRadius="4"
  684. MouseEnter="RectangleReadMode_MouseEnter"
  685. MouseLeave="ReadModeContent_MouseLeave"
  686. Visibility="Collapsed">
  687. <ContentControl prism:RegionManager.RegionName="{Binding ReadModeRegionName}" />
  688. </Border>
  689. <Rectangle
  690. x:Name="RectangleReadMode"
  691. Grid.RowSpan="4"
  692. Width="{Binding ActualWidth, ElementName=ReadModeContent, Mode=OneWay}"
  693. Height="44"
  694. Margin="0,0,0,5"
  695. HorizontalAlignment="Center"
  696. VerticalAlignment="Bottom"
  697. Fill="Transparent"
  698. MouseEnter="RectangleReadMode_MouseEnter"
  699. Visibility="Collapsed" />
  700. </Grid>
  701. </UserControl>