ViewContent.xaml 37 KB

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