ViewContent.xaml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  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="NumPad0"
  122. Command="{x:Static helper:GlobalCommands.RealSizeCommand}"
  123. Modifiers="Ctrl" />
  124. <KeyBinding
  125. Key="D0"
  126. Command="{x:Static helper:GlobalCommands.RealSizeCommand}"
  127. Modifiers="Ctrl" />
  128. <KeyBinding
  129. Key="Add"
  130. Command="{x:Static helper:GlobalCommands.ZoomInCommand}"
  131. Modifiers="Ctrl" />
  132. <KeyBinding
  133. Key="OemPlus"
  134. Command="{x:Static helper:GlobalCommands.ZoomInCommand}"
  135. Modifiers="Ctrl" />
  136. <KeyBinding
  137. Key="Subtract"
  138. Command="{x:Static helper:GlobalCommands.ZoomOutPageCommand}"
  139. Modifiers="Ctrl" />
  140. <KeyBinding
  141. Key="OemMinus"
  142. Command="{x:Static helper:GlobalCommands.ZoomOutPageCommand}"
  143. Modifiers="Ctrl" />
  144. <KeyBinding
  145. Key="OemOpenBrackets"
  146. Command="{x:Static helper:GlobalCommands.PreViewCommand}"
  147. Modifiers="Ctrl" />
  148. <KeyBinding
  149. Key="OemCloseBrackets"
  150. Command="{x:Static helper:GlobalCommands.NextViewCommand}"
  151. Modifiers="Ctrl" />
  152. </UserControl.InputBindings>
  153. <UserControl.CommandBindings>
  154. <CommandBinding
  155. x:Name="CloseLeftCommand"
  156. Command="{StaticResource CloseLeft}"
  157. Executed="CloseLeftCommand_Executed" />
  158. <CommandBinding
  159. x:Name="AddTabCommand"
  160. Command="{StaticResource AddTab}"
  161. Executed="AddTabCommand_Executed" />
  162. <CommandBinding
  163. x:Name="CloseTabCommand"
  164. Command="{StaticResource CloseTab}"
  165. Executed="CloseTabCommand_Executed" />
  166. <CommandBinding
  167. x:Name="CloseRightCommand"
  168. Command="{StaticResource CloseRight}"
  169. Executed="CloseRightCommand_Executed" />
  170. </UserControl.CommandBindings>
  171. <Grid Background="{StaticResource color.sys.layout.mg}">
  172. <Grid.RowDefinitions>
  173. <RowDefinition Name="HeadRow" Height="40" />
  174. <RowDefinition Name="ToolRow" Height="40" />
  175. <RowDefinition Height="*" />
  176. <RowDefinition Height="32" />
  177. </Grid.RowDefinitions>
  178. <Grid Visibility="{Binding GridVisibility}">
  179. <!-- 左边菜单按钮 -->
  180. <StackPanel
  181. Margin="16,6,0,6"
  182. HorizontalAlignment="Left"
  183. Orientation="Horizontal"
  184. Visibility="{Binding IsReadMode}">
  185. <Button
  186. Name="BtnFile"
  187. Click="BtnFile_Click"
  188. Content="Files"
  189. Initialized="BtnFile_Initialized"
  190. Style="{StaticResource subToolBar}"
  191. ToolTip="{Binding T_File}">
  192. <Button.ContextMenu>
  193. <ContextMenu Name="FileMenu">
  194. <MenuItem
  195. Command="{Binding OpenFileCommand}"
  196. Header="Open Files"
  197. InputGestureText="Ctrl+O" />
  198. <MenuItem
  199. Name="MenuRecent"
  200. Header="Open Recent"
  201. Loaded="MenuRecent_Loaded">
  202. <Separator Name="Menu_Separator" Style="{StaticResource HorizontalSeparatorStyle}" />
  203. <MenuItem
  204. Name="MenuDeleteAll"
  205. Click="MenuDeleteAll_Click"
  206. Header="Delete All" />
  207. </MenuItem>
  208. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  209. <MenuItem Header="Create Files">
  210. <MenuItem Command="{Binding CreateFromFile}" Header="Create From File" />
  211. <MenuItem Command="{Binding CreateBlankFileCommand}" Header="Create Blank Page" />
  212. <MenuItem
  213. Command="{Binding mainViewModel.homeContentViewModel.CreateFromScanner}"
  214. CommandParameter="View"
  215. Header="Create Form Scanner" />
  216. </MenuItem>
  217. <MenuItem
  218. Command="{Binding mainViewModel.mainWindowViewModel.AddTab}"
  219. Header="New Tab"
  220. InputGestureText="Ctrl+T" />
  221. <MenuItem Command="{Binding MergeFileCommand}" Header="Merge PDF Files" />
  222. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  223. <MenuItem
  224. Command="{Binding SaveFile}"
  225. Header="Save"
  226. InputGestureText="Ctrl+S" />
  227. <MenuItem
  228. Command="{Binding SaveAsFile}"
  229. Header="Save As"
  230. InputGestureText="Ctrl+Shift+S" />
  231. <MenuItem
  232. Command="{Binding SaveAsFlattenCommand}"
  233. Header="Save as Flattened PDF"
  234. Visibility="Collapsed" />
  235. <MenuItem Command="{Binding CompressCommand}" Header="Compress" />
  236. <MenuItem Header="Convert To">
  237. <MenuItem
  238. Command="{Binding ConvertCommand}"
  239. CommandParameter="Word"
  240. Header="Word" />
  241. <MenuItem
  242. Command="{Binding ConvertCommand}"
  243. CommandParameter="Excel"
  244. Header="Excel" />
  245. <MenuItem
  246. Command="{Binding ConvertCommand}"
  247. CommandParameter="PPT"
  248. Header="PowerPoint" />
  249. <MenuItem
  250. Command="{Binding ConvertCommand}"
  251. CommandParameter="RTF"
  252. Header="RTF" />
  253. <MenuItem
  254. Command="{Binding ConvertCommand}"
  255. CommandParameter="HTML"
  256. Header="HTML" />
  257. <MenuItem
  258. Command="{Binding ConvertCommand}"
  259. CommandParameter="Text"
  260. Header="Text" />
  261. <MenuItem
  262. Command="{Binding ConvertCommand}"
  263. CommandParameter="CSV"
  264. Header="CSV" />
  265. <MenuItem
  266. Command="{Binding ConvertCommand}"
  267. CommandParameter="Image"
  268. Header="Image" />
  269. </MenuItem>
  270. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  271. <MenuItem
  272. Command="{Binding CloseWindowCommand}"
  273. Header="Close Window"
  274. InputGestureText="Ctrl+Shift+W" />
  275. <MenuItem
  276. Command="{Binding mainViewModel.CloseTab}"
  277. Header="Close Tab"
  278. InputGestureText="Ctrl+W" />
  279. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  280. <MenuItem Command="{Binding EncryptCommand}" Header="Set Passwords" />
  281. <MenuItem Command="{Binding DecryptCommand}" Header="Remove Security" />
  282. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  283. <MenuItem Command="{Binding ShowInFolderCommand}" Header="Show in Folder" />
  284. <MenuItem Command="{Binding PropertyCommand}" Header="Properties" />
  285. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  286. <MenuItem Command="{Binding ShareCommand}" Header="Share" />
  287. <MenuItem
  288. Command="{Binding PrintCommand}"
  289. Header="Print"
  290. InputGestureText="Ctrl+P" />
  291. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  292. <MenuItem Command="{Binding SettingsCommand}" Header="Settings" />
  293. <MenuItem Header="Help">
  294. <MenuItem
  295. Command="{Binding HelpCommand}"
  296. CommandParameter="Guid"
  297. Header="Quick Guide" />
  298. <MenuItem
  299. Command="{Binding HelpCommand}"
  300. CommandParameter="Online"
  301. Header="在线帮助"
  302. Visibility="Collapsed" />
  303. <MenuItem
  304. Command="{Binding HelpCommand}"
  305. CommandParameter="More"
  306. Header="More Products" />
  307. <MenuItem
  308. Command="{Binding HelpCommand}"
  309. CommandParameter="Template"
  310. Header="Free Template" />
  311. <MenuItem
  312. Command="{Binding HelpCommand}"
  313. CommandParameter="Blog"
  314. Header="订阅电子报"
  315. Visibility="Collapsed" />
  316. <MenuItem
  317. Command="{Binding HelpCommand}"
  318. CommandParameter="ComPDF"
  319. Header="Powered by ComPDFKit" />
  320. <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
  321. <MenuItem
  322. Command="{Binding HelpCommand}"
  323. CommandParameter="FeedBack"
  324. Header="Feedback" />
  325. </MenuItem>
  326. </ContextMenu>
  327. </Button.ContextMenu>
  328. </Button>
  329. <Separator
  330. Width="1"
  331. Height="12"
  332. Margin="8,0"
  333. Background="{StaticResource color.sys.layout.divider}"
  334. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  335. <Button
  336. Command="{Binding SaveFile}"
  337. IsEnabled="{Binding CanSave}"
  338. Style="{StaticResource subToolBar}"
  339. ToolTip="{Binding T_Save}">
  340. <Path
  341. Width="20"
  342. Height="20"
  343. 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"
  344. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  345. </Button>
  346. <Button
  347. Margin="2,0"
  348. Command="{Binding UndoCommand}"
  349. IsEnabled="{Binding CanUndo}"
  350. Style="{StaticResource subToolBar}"
  351. ToolTip="{Binding T_Undo}">
  352. <Path
  353. Width="20"
  354. Height="20"
  355. 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"
  356. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  357. </Button>
  358. <Button
  359. Command="{Binding RedoCommand}"
  360. IsEnabled="{Binding CanRedo}"
  361. Style="{StaticResource subToolBar}"
  362. ToolTip="{Binding T_Redo}">
  363. <Path
  364. Width="20"
  365. Height="20"
  366. 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"
  367. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  368. </Button>
  369. <Button
  370. x:Name="ButLeft"
  371. Width="20"
  372. Height="40"
  373. HorizontalAlignment="Left"
  374. VerticalAlignment="Center"
  375. Click="ButLeft_Click"
  376. Content="&lt;"
  377. Style="{StaticResource subToolBar}"
  378. Visibility="Collapsed" />
  379. </StackPanel>
  380. <!-- 右边菜单按钮 -->
  381. <StackPanel
  382. Margin="0,6,16,6"
  383. HorizontalAlignment="Right"
  384. Orientation="Horizontal"
  385. Visibility="{Binding IsReadMode}">
  386. <Button
  387. x:Name="ButRight"
  388. Width="20"
  389. Height="40"
  390. HorizontalAlignment="Right"
  391. VerticalAlignment="Center"
  392. Click="ButRight_Click"
  393. Content="&gt;"
  394. Style="{StaticResource subToolBar}"
  395. Visibility="Collapsed" />
  396. <Button
  397. Command="{Binding PrintCommand}"
  398. Style="{StaticResource subToolBar}"
  399. ToolTip="{Binding T_Print}">
  400. <Path
  401. Width="20"
  402. Height="20"
  403. 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"
  404. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  405. </Button>
  406. <Button
  407. Margin="2,0"
  408. Command="{Binding ShareCommand}"
  409. Style="{StaticResource subToolBar}"
  410. ToolTip="{Binding T_Share}">
  411. <Path
  412. Width="20"
  413. Height="20"
  414. 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"
  415. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  416. </Button>
  417. <ToggleButton
  418. Name="TbtnProperty"
  419. Width="28"
  420. Height="28"
  421. BorderThickness="0"
  422. Command="{Binding OpenPropertyCommand}"
  423. CommandParameter="{Binding ElementName=TbtnProperty, Path=IsChecked}"
  424. IsChecked="{Binding IsPropertyOpen, Mode=TwoWay}"
  425. IsEnabled="{Binding isInPageEdit, Converter={StaticResource UnBoolConvert}}"
  426. Style="{StaticResource SubToolbarTgb}"
  427. ToolTip="{Binding T_Properties}">
  428. <Path
  429. Width="20"
  430. Height="20"
  431. 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"
  432. Fill="{Binding ElementName=TbtnProperty, Path=Foreground}" />
  433. </ToggleButton>
  434. </StackPanel>
  435. <ScrollViewer
  436. x:Name="ScrViewTab"
  437. Margin="170,0,128,0"
  438. VerticalAlignment="Center"
  439. CanContentScroll="False"
  440. HorizontalScrollBarVisibility="Hidden"
  441. ScrollChanged="ScrViewTab_ScrollChanged"
  442. VerticalScrollBarVisibility="Disabled">
  443. <TabControl
  444. x:Name="ToolTabControl"
  445. Grid.Row="0"
  446. Grid.RowSpan="2"
  447. HorizontalAlignment="Center"
  448. VerticalAlignment="Top"
  449. BorderThickness="0"
  450. PreviewMouseLeftButtonDown="ToolTabControl_PreviewMouseLeftButtonDown"
  451. SelectedIndex="{Binding TabSelectedIndex, Mode=TwoWay}"
  452. Style="{StaticResource TabControlWithUnderLineStyle}"
  453. Visibility="{Binding IsReadMode}">
  454. <cus:IconAndTextTabItem
  455. x:Name="TabItemAnnotation"
  456. Header="{Binding T_Annotation}"
  457. Style="{StaticResource ToolbarTabs}">
  458. <Grid Grid.Row="1" Height="40" />
  459. </cus:IconAndTextTabItem>
  460. <cus:IconAndTextTabItem
  461. x:Name="TabItemPageEdit"
  462. Header="{Binding T_PageEdit}"
  463. Style="{StaticResource ToolbarTabs}" />
  464. <cus:IconAndTextTabItem
  465. x:Name="TabItemConvert"
  466. Header="{Binding T_Converter}"
  467. Style="{StaticResource ToolbarTabs}" />
  468. <cus:IconAndTextTabItem
  469. x:Name="TabItemScan"
  470. Header="扫描和OCR"
  471. Style="{StaticResource ToolbarTabs}"
  472. Visibility="Collapsed">
  473. <Grid Grid.Row="1" Height="40" />
  474. </cus:IconAndTextTabItem>
  475. <cus:IconAndTextTabItem
  476. x:Name="TabItemEdit"
  477. Height="40"
  478. Header="编辑"
  479. Style="{StaticResource ToolbarTabs}"
  480. Visibility="Collapsed">
  481. <Grid Grid.Row="1" Height="40" />
  482. </cus:IconAndTextTabItem>
  483. <cus:IconAndTextTabItem
  484. x:Name="TabItemForm"
  485. Height="40"
  486. Header="表单"
  487. Style="{StaticResource ToolbarTabs}"
  488. Visibility="Collapsed">
  489. <Grid Grid.Row="1" Height="40" />
  490. </cus:IconAndTextTabItem>
  491. <cus:IconAndTextTabItem
  492. x:Name="TabItemFill"
  493. Height="40"
  494. Header="{Binding T_FillSign}"
  495. Style="{StaticResource ToolbarTabs}">
  496. <Grid Grid.Row="1" Height="40" />
  497. </cus:IconAndTextTabItem>
  498. <cus:IconAndTextTabItem
  499. x:Name="TabItemTool"
  500. Height="40"
  501. Header="{Binding T_Tools}"
  502. Style="{StaticResource ToolbarTabs}">
  503. <Grid Grid.Row="1" Height="40" />
  504. </cus:IconAndTextTabItem>
  505. <i:Interaction.Triggers>
  506. <i:EventTrigger EventName="SelectionChanged">
  507. <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
  508. </i:EventTrigger>
  509. </i:Interaction.Triggers>
  510. </TabControl>
  511. </ScrollViewer>
  512. </Grid>
  513. <!-- 底部工具栏 -->
  514. <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
  515. <!-- 专门用来显示菜单二级工具栏 -->
  516. <!-- 调整工具栏的显示图层,方便阅读模式处理 -->
  517. <ContentControl
  518. Name="ContentToolsBar"
  519. Grid.Row="{Binding GridToolRow}"
  520. prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
  521. Visibility="{Binding ToolsBarContentVisible}" />
  522. <!--<ContentControl
  523. Name="ContentConverterBar"
  524. Grid.Row="{Binding GridToolRow}"
  525. prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
  526. Visibility="{Binding ConverterBarContentVisible}" />-->
  527. <ContentControl
  528. Name="TextEditContentBar"
  529. Grid.Row="{Binding GridToolRow}"
  530. prism:RegionManager.RegionName="{Binding TextEditContentRegionName}"
  531. Visibility="{Binding TextEditToolContentVisible}" />
  532. <Border
  533. Name="DocumentView"
  534. Grid.Row="2"
  535. BorderBrush="{StaticResource color.sys.layout.divider}"
  536. BorderThickness="0,1,0,0">
  537. <Grid Panel.ZIndex="0">
  538. <Grid.ColumnDefinitions>
  539. <ColumnDefinition
  540. x:Name="BOTACloumn"
  541. Width="{Binding BOTAWidth, Mode=TwoWay}"
  542. MinWidth="48"
  543. MaxWidth="472" />
  544. <ColumnDefinition Width="auto" />
  545. <ColumnDefinition
  546. Name="ViewerColumn"
  547. Width="*"
  548. MinWidth="200" />
  549. <ColumnDefinition Name="PropertyColumn" MinWidth="0">
  550. <ColumnDefinition.Style>
  551. <Style TargetType="{x:Type ColumnDefinition}">
  552. <Style.Triggers>
  553. <DataTrigger Binding="{Binding ElementName=TbtnProperty, Path=IsChecked}" Value="True">
  554. <Setter Property="Width" Value="260" />
  555. </DataTrigger>
  556. <DataTrigger Binding="{Binding ElementName=TbtnProperty, Path=IsChecked}" Value="False">
  557. <Setter Property="Width" Value="0" />
  558. </DataTrigger>
  559. </Style.Triggers>
  560. </Style>
  561. </ColumnDefinition.Style>
  562. </ColumnDefinition>
  563. </Grid.ColumnDefinitions>
  564. <ContentControl
  565. x:Name="BOTAContent"
  566. prism:RegionManager.RegionName="{Binding BOTARegionName}"
  567. SizeChanged="ContentControl_SizeChanged" />
  568. <GridSplitter
  569. Name="BOTASplitter"
  570. Grid.Column="1"
  571. Width="3"
  572. Background="Transparent"
  573. Cursor="SizeWE"
  574. FocusVisualStyle="{x:Null}"
  575. ResizeBehavior="PreviousAndNext"
  576. ShowsPreview="True" />
  577. <Grid Name="GridViewer" Grid.Column="2">
  578. <!-- 分屏功能需要的布局 -->
  579. <Grid.RowDefinitions>
  580. <RowDefinition Height="*" />
  581. <RowDefinition Height="auto" />
  582. <RowDefinition Name="RowRight" Height="0" />
  583. </Grid.RowDefinitions>
  584. <Grid.ColumnDefinitions>
  585. <ColumnDefinition Width="*" />
  586. <ColumnDefinition Name="ColumnSplitter" Width="auto" />
  587. <ColumnDefinition Name="ColumnBottom" Width="0" />
  588. </Grid.ColumnDefinitions>
  589. <ContentControl />
  590. <ContentControl
  591. x:Name="PDFViewerContent"
  592. HorizontalAlignment="Stretch"
  593. prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
  594. <ContentControl
  595. Name="SplitPDFViewer"
  596. Grid.Row="2"
  597. Grid.Column="2"
  598. prism:RegionManager.RegionName="{Binding SplitViewerRegionName}" />
  599. <GridSplitter
  600. Name="VerticalSplitter"
  601. Grid.Column="1"
  602. Width="12"
  603. Background="Gray"
  604. BorderThickness="0"
  605. ResizeBehavior="PreviousAndNext"
  606. ShowsPreview="True"
  607. Visibility="Collapsed" />
  608. <GridSplitter
  609. Name="HorizontalSplitter"
  610. Grid.Row="1"
  611. Height="12"
  612. HorizontalAlignment="Stretch"
  613. Background="Gray"
  614. BorderThickness="0"
  615. ResizeBehavior="PreviousAndNext"
  616. ShowsPreview="True"
  617. Visibility="Collapsed" />
  618. </Grid>
  619. <ContentControl
  620. x:Name="OCRViewerContent"
  621. Grid.ColumnSpan="3"
  622. HorizontalAlignment="Stretch"
  623. prism:RegionManager.RegionName="{Binding OCRViewerRegionName}"
  624. Visibility="{Binding OCRContentVisible}" />
  625. <ScrollViewer
  626. Name="Scroller"
  627. Grid.Column="4"
  628. Focusable="False"
  629. VerticalScrollBarVisibility="Auto">
  630. <ContentControl Height="{Binding ElementName=Scroller, Path=ViewportHeight}" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
  631. </ScrollViewer>
  632. <!-- 阅读页顶部提示栏区域 -->
  633. <ContentControl
  634. Grid.Column="2"
  635. Width="{Binding ElementName=PDFViewerContent, Path=Width}"
  636. VerticalAlignment="Top"
  637. prism:RegionManager.RegionName="{Binding TipContentRegionName}"
  638. Visibility="{Binding TipVisible}" />
  639. <!-- 阅读页顶部侧面提示区域 -->
  640. <ContentControl
  641. Grid.Column="2"
  642. Margin="16,8"
  643. HorizontalAlignment="Right"
  644. VerticalAlignment="Top"
  645. prism:RegionManager.RegionName="{Binding LeftTipContentRegionName}"
  646. Visibility="{Binding LeftTipVisible}" />
  647. <!-- 便签弹窗 -->
  648. <Canvas
  649. x:Name="CanvasNote"
  650. Grid.Column="2"
  651. Visibility="{Binding NotePopupVisible}">
  652. <StackPanel Canvas.Left="{Binding CanvasNoteLeft}" Canvas.Bottom="{Binding CanvasNoteBottom}">
  653. <!--<TextBlock Text="000" />-->
  654. <ContentControl prism:RegionManager.RegionName="{Binding NotePopupRegionName}" />
  655. </StackPanel>
  656. </Canvas>
  657. </Grid>
  658. </Border>
  659. <!-- 用于显示页面编辑、水印、背景、标记密文等功能的区域 -->
  660. <Border
  661. Grid.Row="{Binding GridToolRow}"
  662. Grid.RowSpan="{Binding GridToolRowSpan}"
  663. BorderBrush="{StaticResource color.sys.layout.divider}"
  664. BorderThickness="0,1"
  665. Visibility="{Binding ToolContentVisible}">
  666. <ContentControl Name="ContentTool" prism:RegionManager.RegionName="{Binding ToolContentRegionName}" />
  667. </Border>
  668. <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
  669. <Rectangle
  670. x:Name="RectangleBota"
  671. Grid.Row="2"
  672. Width="10"
  673. Height="{Binding ActualHeight, ElementName=GridViewer, Mode=OneWay}"
  674. Margin="0,0,0,0"
  675. HorizontalAlignment="Left"
  676. VerticalAlignment="Bottom"
  677. Fill="Red"
  678. Visibility="Collapsed" />
  679. <!-- 阅读模式下的页面控件 -->
  680. <Border
  681. x:Name="ReadModeContent"
  682. Grid.RowSpan="4"
  683. Height="44"
  684. Margin="0,0,0,16"
  685. HorizontalAlignment="Center"
  686. VerticalAlignment="Bottom"
  687. CornerRadius="4"
  688. MouseEnter="RectangleReadMode_MouseEnter"
  689. MouseLeave="ReadModeContent_MouseLeave"
  690. Visibility="Collapsed">
  691. <ContentControl prism:RegionManager.RegionName="{Binding ReadModeRegionName}" />
  692. </Border>
  693. <Rectangle
  694. x:Name="RectangleReadMode"
  695. Grid.RowSpan="4"
  696. Width="{Binding ActualWidth, ElementName=ReadModeContent, Mode=OneWay}"
  697. Height="44"
  698. Margin="0,0,0,5"
  699. HorizontalAlignment="Center"
  700. VerticalAlignment="Bottom"
  701. Fill="Transparent"
  702. MouseEnter="RectangleReadMode_MouseEnter"
  703. Visibility="Collapsed" />
  704. </Grid>
  705. </UserControl>