ViewContent.xaml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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. KeyDown="UserControl_KeyDown"
  24. MouseDown="UserControl_MouseDown"
  25. Unloaded="UserControl_Unloaded"
  26. mc:Ignorable="d">
  27. <i:Interaction.Triggers>
  28. <i:EventTrigger EventName="Loaded">
  29. <prism:InvokeCommandAction Command="{Binding Load}" />
  30. </i:EventTrigger>
  31. <i:EventTrigger EventName="PreviewMouseDown">
  32. <prism:InvokeCommandAction Command="{Binding MouseDown}" />
  33. </i:EventTrigger>
  34. </i:Interaction.Triggers>
  35. <UserControl.Resources>
  36. <ResourceDictionary>
  37. <ResourceDictionary.MergedDictionaries>
  38. <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
  39. </ResourceDictionary.MergedDictionaries>
  40. <convert:InvertBoolConvert x:Key="UnBoolConvert" />
  41. <Style x:Key="MenuButtonStyle" TargetType="{x:Type Button}">
  42. <Setter Property="Width" Value="20" />
  43. <Setter Property="Height" Value="20" />
  44. </Style>
  45. <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
  46. <RoutedUICommand x:Key="CloseLeft" Text="CloseLeft" />
  47. <RoutedUICommand x:Key="CloseRight" Text="CloseRight" />
  48. <RoutedUICommand x:Key="AddTab" Text="AddTab" />
  49. <RoutedUICommand x:Key="CloseTab" Text="CloseTab" />
  50. </ResourceDictionary>
  51. </UserControl.Resources>
  52. <UserControl.InputBindings>
  53. <KeyBinding
  54. Key="F4"
  55. Command="{StaticResource CloseLeft}"
  56. Modifiers="Ctrl" />
  57. <KeyBinding
  58. Key="F4"
  59. Command="{StaticResource CloseRight}"
  60. Modifiers="Ctrl+Shift" />
  61. <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O" />
  62. <KeyBinding
  63. Key="T"
  64. Command="{StaticResource AddTab}"
  65. Modifiers="Ctrl" />
  66. <KeyBinding Command="{Binding SaveFile}" Gesture="Ctrl+S" />
  67. <KeyBinding Command="{Binding SaveAsFile}" Gesture="Ctrl+Shift+S" />
  68. <KeyBinding Command="{Binding CloseWindowCommand}" Gesture="Ctrl+Shift+W" />
  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="{x:Static helper:GlobalCommands.FirstPageCommand}"
  89. Modifiers="Ctrl" />
  90. <KeyBinding
  91. Key="Down"
  92. Command="{x:Static helper:GlobalCommands.LastPageCommand}"
  93. Modifiers="Ctrl" />
  94. <KeyBinding Key="Up" Command="{x:Static helper:GlobalCommands.UpCommand}" />
  95. <KeyBinding Key="Down" Command="{x:Static helper:GlobalCommands.DownCommand}" />
  96. <KeyBinding Key="Left" Command="{x:Static helper:GlobalCommands.PrePageCommand}" />
  97. <KeyBinding Key="PageUp" Command="{x:Static helper:GlobalCommands.PrePageCommand}" />
  98. <KeyBinding Key="PageDown" Command="{x:Static helper:GlobalCommands.NextPageCommand}" />
  99. <KeyBinding Key="Right" Command="{x:Static helper:GlobalCommands.NextPageCommand}" />
  100. <KeyBinding
  101. Key="OemOpenBrackets"
  102. Command="{x:Static helper:GlobalCommands.PreViewCommand}"
  103. Modifiers="Ctrl" />
  104. <KeyBinding
  105. Key="OemCloseBrackets"
  106. Command="{x:Static helper:GlobalCommands.NextViewCommand}"
  107. Modifiers="Ctrl" />
  108. </UserControl.InputBindings>
  109. <UserControl.CommandBindings>
  110. <CommandBinding
  111. x:Name="CloseLeftCommand"
  112. Command="{StaticResource CloseLeft}"
  113. Executed="CloseLeftCommand_Executed" />
  114. <CommandBinding
  115. x:Name="AddTabCommand"
  116. Command="{StaticResource AddTab}"
  117. Executed="AddTabCommand_Executed" />
  118. <CommandBinding
  119. x:Name="CloseTabCommand"
  120. Command="{StaticResource CloseTab}"
  121. Executed="CloseTabCommand_Executed" />
  122. <CommandBinding
  123. x:Name="CloseRightCommand"
  124. Command="{StaticResource CloseRight}"
  125. Executed="CloseRightCommand_Executed" />
  126. </UserControl.CommandBindings>
  127. <Grid Background="{StaticResource color.sys.layout.mg}">
  128. <Grid.RowDefinitions>
  129. <RowDefinition Name="HeadRow" Height="40" />
  130. <RowDefinition Name="ToolRow" Height="40" />
  131. <RowDefinition Height="*" />
  132. <RowDefinition Height="32" />
  133. </Grid.RowDefinitions>
  134. <Grid Visibility="{Binding GridVisibility}">
  135. <!-- 左边菜单按钮 -->
  136. <StackPanel
  137. Margin="16,6,0,6"
  138. HorizontalAlignment="Left"
  139. Orientation="Horizontal"
  140. Visibility="{Binding IsReadMode}">
  141. <Button
  142. Name="BtnFile"
  143. Click="BtnFile_Click"
  144. Content="Files"
  145. Initialized="BtnFile_Initialized"
  146. Style="{StaticResource subToolBar}"
  147. ToolTip="{Binding T_File}">
  148. <Button.ContextMenu>
  149. <ContextMenu Name="FileMenu">
  150. <MenuItem
  151. Command="{Binding OpenFileCommand}"
  152. Header="Open Files"
  153. InputGestureText="Ctrl+O" />
  154. <MenuItem
  155. Name="MenuRecent"
  156. Header="Open Recent"
  157. Loaded="MenuRecent_Loaded">
  158. <Separator Name="Menu_Separator" Style="{StaticResource HorizontalSeparatorStyle}" />
  159. <MenuItem
  160. Name="MenuDeleteAll"
  161. Click="MenuDeleteAll_Click"
  162. Header="Delete All" />
  163. </MenuItem>
  164. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  165. <MenuItem Header="Create Files">
  166. <MenuItem Command="{Binding CreateFromFile}" Header="Create From File" />
  167. <MenuItem Command="{Binding CreateBlankFileCommand}" Header="Create Blank" />
  168. <MenuItem
  169. Command="{Binding mainViewModel.homeContentViewModel.CreateFromScanner}"
  170. CommandParameter="View"
  171. Header="Create Form Scanner" />
  172. </MenuItem>
  173. <MenuItem
  174. Command="{Binding mainViewModel.mainWindowViewModel.AddTab}"
  175. Header="New Tab"
  176. InputGestureText="Ctrl+T" />
  177. <MenuItem Command="{Binding MergeFileCommand}" Header="Merge PDF Files" />
  178. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  179. <MenuItem
  180. Command="{Binding SaveFile}"
  181. Header="Save"
  182. InputGestureText="Ctrl+S" />
  183. <MenuItem
  184. Command="{Binding SaveAsFile}"
  185. Header="Save As"
  186. InputGestureText="Ctrl+Shift+S" />
  187. <MenuItem
  188. Command="{Binding SaveAsFlattenCommand}"
  189. Header="Save as Flattened PDF"
  190. Visibility="Collapsed" />
  191. <MenuItem Command="{Binding CompressCommand}" Header="Compress" />
  192. <MenuItem Header="Convert To">
  193. <MenuItem
  194. Command="{Binding ConvertCommand}"
  195. CommandParameter="Word"
  196. Header="Word" />
  197. <MenuItem
  198. Command="{Binding ConvertCommand}"
  199. CommandParameter="Excel"
  200. Header="Excel" />
  201. <MenuItem
  202. Command="{Binding ConvertCommand}"
  203. CommandParameter="PPT"
  204. Header="PowerPoint" />
  205. <MenuItem
  206. Command="{Binding ConvertCommand}"
  207. CommandParameter="RTF"
  208. Header="RTF" />
  209. <MenuItem
  210. Command="{Binding ConvertCommand}"
  211. CommandParameter="HTML"
  212. Header="HTML" />
  213. <MenuItem
  214. Command="{Binding ConvertCommand}"
  215. CommandParameter="Text"
  216. Header="Text" />
  217. <MenuItem
  218. Command="{Binding ConvertCommand}"
  219. CommandParameter="CSV"
  220. Header="CSV" />
  221. <MenuItem
  222. Command="{Binding ConvertCommand}"
  223. CommandParameter="Image"
  224. Header="图片" />
  225. </MenuItem>
  226. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  227. <MenuItem
  228. Command="{Binding CloseWindowCommand}"
  229. Header="Close Window"
  230. InputGestureText="Ctrl+Shift+W" />
  231. <MenuItem
  232. Command="{Binding mainViewModel.CloseTab}"
  233. Header="Close Tab"
  234. InputGestureText="Ctrl+W" />
  235. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  236. <MenuItem Command="{Binding EncryptCommand}" Header="Set Passwords" />
  237. <MenuItem Command="{Binding DecryptCommand}" Header="Remove Security" />
  238. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  239. <MenuItem Command="{Binding ShowInFolderCommand}" Header="Show in Folder" />
  240. <MenuItem Command="{Binding PropertyCommand}" Header="Properties" />
  241. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  242. <MenuItem Command="{Binding ShareCommand}" Header="Share" />
  243. <MenuItem
  244. Command="{Binding PrintCommand}"
  245. Header="Print"
  246. InputGestureText="Ctrl+P" />
  247. <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
  248. <MenuItem Command="{Binding SettingsCommand}" Header="Settings" />
  249. <MenuItem Header="Help">
  250. <MenuItem
  251. Command="{Binding HelpCommand}"
  252. CommandParameter="Guid"
  253. Header="快速教学" />
  254. <MenuItem
  255. Command="{Binding HelpCommand}"
  256. CommandParameter="Online"
  257. Header="在线帮助"
  258. Visibility="Collapsed" />
  259. <MenuItem
  260. Command="{Binding HelpCommand}"
  261. CommandParameter="More"
  262. Header="更多产品" />
  263. <MenuItem
  264. Command="{Binding HelpCommand}"
  265. CommandParameter="Template"
  266. Header="免费PDF模板" />
  267. <MenuItem
  268. Command="{Binding HelpCommand}"
  269. CommandParameter="Blog"
  270. Header="订阅电子报"
  271. Visibility="Collapsed" />
  272. <MenuItem
  273. Command="{Binding HelpCommand}"
  274. CommandParameter="ComPDF"
  275. Header="Powered by ComPDFKit" />
  276. <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
  277. <MenuItem
  278. Command="{Binding HelpCommand}"
  279. CommandParameter="FeedBack"
  280. Header="意见反馈" />
  281. </MenuItem>
  282. </ContextMenu>
  283. </Button.ContextMenu>
  284. </Button>
  285. <Separator
  286. Width="1"
  287. Height="12"
  288. Margin="8,0"
  289. Background="{StaticResource color.sys.layout.divider}"
  290. Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
  291. <Button
  292. Command="{Binding SaveFile}"
  293. IsEnabled="{Binding CanSave}"
  294. Style="{StaticResource subToolBar}"
  295. ToolTip="{Binding T_Save}">
  296. <Path
  297. Width="20"
  298. Height="20"
  299. 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"
  300. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  301. </Button>
  302. <Button
  303. Margin="2,0"
  304. Command="{Binding UndoCommand}"
  305. IsEnabled="{Binding CanUndo}"
  306. Style="{StaticResource subToolBar}"
  307. ToolTip="{Binding T_Undo}">
  308. <Path
  309. Width="20"
  310. Height="20"
  311. 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"
  312. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  313. </Button>
  314. <Button
  315. Command="{Binding RedoCommand}"
  316. IsEnabled="{Binding CanRedo}"
  317. Style="{StaticResource subToolBar}"
  318. ToolTip="{Binding T_Redo}">
  319. <Path
  320. Width="20"
  321. Height="20"
  322. 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"
  323. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  324. </Button>
  325. </StackPanel>
  326. <!-- 右边菜单按钮 -->
  327. <StackPanel
  328. Margin="0,6,16,6"
  329. HorizontalAlignment="Right"
  330. Orientation="Horizontal"
  331. Visibility="{Binding IsReadMode}">
  332. <Button
  333. Command="{Binding PrintCommand}"
  334. Style="{StaticResource subToolBar}"
  335. ToolTip="{Binding T_Print}">
  336. <Path
  337. Width="20"
  338. Height="20"
  339. 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"
  340. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  341. </Button>
  342. <Button
  343. Margin="2,0"
  344. Command="{Binding ShareCommand}"
  345. Style="{StaticResource subToolBar}"
  346. ToolTip="{Binding T_Share}">
  347. <Path
  348. Width="20"
  349. Height="20"
  350. 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"
  351. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  352. </Button>
  353. <ToggleButton
  354. Name="TbtnProperty"
  355. Width="28"
  356. Height="28"
  357. BorderThickness="0"
  358. Command="{Binding OpenPropertyCommand}"
  359. CommandParameter="{Binding ElementName=TbtnProperty, Path=IsChecked}"
  360. IsChecked="{Binding IsPropertyOpen, Mode=OneWay}"
  361. IsEnabled="{Binding isInPageEdit, Converter={StaticResource UnBoolConvert}}"
  362. Style="{StaticResource SubToolbarTgb}"
  363. ToolTip="{Binding T_Properties}">
  364. <Path
  365. Width="20"
  366. Height="20"
  367. 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"
  368. Fill="{Binding ElementName=TbtnProperty, Path=Foreground}" />
  369. </ToggleButton>
  370. </StackPanel>
  371. <TabControl
  372. x:Name="ToolTabControl"
  373. Grid.Row="0"
  374. Grid.RowSpan="2"
  375. HorizontalAlignment="Center"
  376. VerticalAlignment="Top"
  377. BorderThickness="0"
  378. PreviewMouseLeftButtonDown="ToolTabControl_PreviewMouseLeftButtonDown"
  379. SelectedIndex="{Binding TabSelectedIndex, Mode=TwoWay}"
  380. Style="{StaticResource TabControlWithUnderLineStyle}"
  381. Visibility="{Binding IsReadMode}">
  382. <cus:IconAndTextTabItem
  383. x:Name="TabItemAnnotation"
  384. Header="{Binding T_Annotation}"
  385. Style="{StaticResource ToolbarTabs}">
  386. <Grid Grid.Row="1" Height="40" />
  387. </cus:IconAndTextTabItem>
  388. <cus:IconAndTextTabItem
  389. x:Name="TabItemPageEdit"
  390. Header="{Binding T_PageEdit}"
  391. Style="{StaticResource ToolbarTabs}" />
  392. <cus:IconAndTextTabItem
  393. x:Name="TabItemConvert"
  394. Header="{Binding T_Converter}"
  395. Style="{StaticResource ToolbarTabs}" />
  396. <cus:IconAndTextTabItem
  397. x:Name="TabItemScan"
  398. Header="扫描和OCR"
  399. Style="{StaticResource ToolbarTabs}"
  400. Visibility="Collapsed">
  401. <Grid Grid.Row="1" Height="40" />
  402. </cus:IconAndTextTabItem>
  403. <cus:IconAndTextTabItem
  404. x:Name="TabItemEdit"
  405. Height="40"
  406. Header="编辑"
  407. Style="{StaticResource ToolbarTabs}"
  408. Visibility="Collapsed">
  409. <Grid Grid.Row="1" Height="40" />
  410. </cus:IconAndTextTabItem>
  411. <cus:IconAndTextTabItem
  412. x:Name="TabItemForm"
  413. Height="40"
  414. Header="表单"
  415. Style="{StaticResource ToolbarTabs}"
  416. Visibility="Collapsed">
  417. <Grid Grid.Row="1" Height="40" />
  418. </cus:IconAndTextTabItem>
  419. <cus:IconAndTextTabItem
  420. x:Name="TabItemFill"
  421. Height="40"
  422. Header="{Binding T_FillSign}"
  423. Style="{StaticResource ToolbarTabs}">
  424. <Grid Grid.Row="1" Height="40" />
  425. </cus:IconAndTextTabItem>
  426. <cus:IconAndTextTabItem
  427. x:Name="TabItemTool"
  428. Height="40"
  429. Header="{Binding T_Tools}"
  430. Style="{StaticResource ToolbarTabs}">
  431. <Grid Grid.Row="1" Height="40" />
  432. </cus:IconAndTextTabItem>
  433. <i:Interaction.Triggers>
  434. <i:EventTrigger EventName="SelectionChanged">
  435. <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
  436. </i:EventTrigger>
  437. </i:Interaction.Triggers>
  438. </TabControl>
  439. </Grid>
  440. <!-- 底部工具栏 -->
  441. <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
  442. <!-- 专门用来显示菜单二级工具栏 -->
  443. <!-- 调整工具栏的显示图层,方便阅读模式处理 -->
  444. <ContentControl
  445. Name="ContentToolsBar"
  446. Grid.Row="{Binding GridToolRow}"
  447. prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
  448. Visibility="{Binding ToolsBarContentVisible}" />
  449. <!--<ContentControl
  450. Name="ContentConverterBar"
  451. Grid.Row="{Binding GridToolRow}"
  452. prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
  453. Visibility="{Binding ConverterBarContentVisible}" />-->
  454. <ContentControl
  455. Name="TextEditContentBar"
  456. Grid.Row="{Binding GridToolRow}"
  457. prism:RegionManager.RegionName="{Binding TextEditContentRegionName}"
  458. Visibility="{Binding TextEditToolContentVisible}" />
  459. <Grid
  460. Name="DocumentView"
  461. Grid.Row="2"
  462. Panel.ZIndex="0">
  463. <Grid.ColumnDefinitions>
  464. <ColumnDefinition
  465. x:Name="BOTACloumn"
  466. Width="{Binding BOTAWidth, Mode=TwoWay}"
  467. MinWidth="48"
  468. MaxWidth="472" />
  469. <ColumnDefinition Width="auto" />
  470. <ColumnDefinition
  471. Name="ViewerColumn"
  472. Width="*"
  473. MinWidth="200" />
  474. <ColumnDefinition Name="PropertyColumn" MinWidth="0">
  475. <ColumnDefinition.Style>
  476. <Style TargetType="{x:Type ColumnDefinition}">
  477. <Style.Triggers>
  478. <DataTrigger Binding="{Binding ElementName=TbtnProperty, Path=IsChecked}" Value="True">
  479. <Setter Property="Width" Value="260" />
  480. </DataTrigger>
  481. <DataTrigger Binding="{Binding ElementName=TbtnProperty, Path=IsChecked}" Value="False">
  482. <Setter Property="Width" Value="0" />
  483. </DataTrigger>
  484. </Style.Triggers>
  485. </Style>
  486. </ColumnDefinition.Style>
  487. </ColumnDefinition>
  488. </Grid.ColumnDefinitions>
  489. <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" SizeChanged="ContentControl_SizeChanged" />
  490. <GridSplitter
  491. Name="BOTASplitter"
  492. Grid.Column="1"
  493. Width="3"
  494. Background="Transparent"
  495. Cursor="SizeWE"
  496. FocusVisualStyle="{x:Null}"
  497. ResizeBehavior="PreviousAndNext"
  498. ShowsPreview="True" />
  499. <Grid Name="GridViewer" Grid.Column="2">
  500. <!-- 分屏功能需要的布局 -->
  501. <Grid.RowDefinitions>
  502. <RowDefinition Height="*" />
  503. <RowDefinition Height="auto" />
  504. <RowDefinition Name="RowRight" Height="0" />
  505. </Grid.RowDefinitions>
  506. <Grid.ColumnDefinitions>
  507. <ColumnDefinition Width="*" />
  508. <ColumnDefinition Name="ColumnSplitter" Width="auto" />
  509. <ColumnDefinition Name="ColumnBottom" Width="0" />
  510. </Grid.ColumnDefinitions>
  511. <ContentControl />
  512. <ContentControl
  513. x:Name="PDFViewerContent"
  514. HorizontalAlignment="Stretch"
  515. prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
  516. <ContentControl
  517. Name="SplitPDFViewer"
  518. Grid.Row="2"
  519. Grid.Column="2"
  520. prism:RegionManager.RegionName="{Binding SplitViewerRegionName}" />
  521. <GridSplitter
  522. Name="VerticalSplitter"
  523. Grid.Column="1"
  524. Width="12"
  525. Background="Gray"
  526. BorderThickness="0"
  527. ResizeBehavior="PreviousAndNext"
  528. ShowsPreview="True"
  529. Visibility="Collapsed" />
  530. <GridSplitter
  531. Name="HorizontalSplitter"
  532. Grid.Row="1"
  533. Height="12"
  534. HorizontalAlignment="Stretch"
  535. Background="Gray"
  536. BorderThickness="0"
  537. ResizeBehavior="PreviousAndNext"
  538. ShowsPreview="True"
  539. Visibility="Collapsed" />
  540. </Grid>
  541. <ContentControl
  542. x:Name="OCRViewerContent"
  543. Grid.ColumnSpan="3"
  544. HorizontalAlignment="Stretch"
  545. prism:RegionManager.RegionName="{Binding OCRViewerRegionName}"
  546. Visibility="{Binding OCRContentVisible}" />
  547. <ScrollViewer
  548. Name="Scroller"
  549. Grid.Column="4"
  550. Focusable="False"
  551. VerticalScrollBarVisibility="Auto">
  552. <ContentControl Height="{Binding ElementName=Scroller, Path=ViewportHeight}" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
  553. </ScrollViewer>
  554. <!-- 阅读页顶部提示栏区域 -->
  555. <ContentControl
  556. Grid.Column="2"
  557. Width="{Binding ElementName=PDFViewerContent, Path=Width}"
  558. VerticalAlignment="Top"
  559. prism:RegionManager.RegionName="{Binding TipContentRegionName}"
  560. Visibility="{Binding TipVisible}" />
  561. <!-- 阅读页顶部侧面提示区域 -->
  562. <ContentControl
  563. Grid.Column="2"
  564. Margin="16,8"
  565. HorizontalAlignment="Right"
  566. VerticalAlignment="Top"
  567. prism:RegionManager.RegionName="{Binding LeftTipContentRegionName}"
  568. Visibility="{Binding LeftTipVisible}" />
  569. <!-- 便签弹窗 -->
  570. <Canvas
  571. x:Name="CanvasNote"
  572. Grid.Column="2"
  573. Visibility="{Binding NotePopupVisible}">
  574. <StackPanel Canvas.Left="{Binding CanvasNoteLeft}" Canvas.Bottom="{Binding CanvasNoteBottom}">
  575. <!--<TextBlock Text="000" />-->
  576. <ContentControl prism:RegionManager.RegionName="{Binding NotePopupRegionName}" />
  577. </StackPanel>
  578. </Canvas>
  579. </Grid>
  580. <!-- 用于显示页面编辑、水印、背景、标记密文等功能的区域 -->
  581. <Border
  582. Grid.Row="{Binding GridToolRow}"
  583. Grid.RowSpan="{Binding GridToolRowSpan}"
  584. BorderBrush="{StaticResource color.sys.layout.divider}"
  585. BorderThickness="0,1"
  586. Visibility="{Binding ToolContentVisible}">
  587. <ContentControl Name="ContentTool" prism:RegionManager.RegionName="{Binding ToolContentRegionName}" />
  588. </Border>
  589. <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
  590. <!-- 阅读模式下的页面控件 -->
  591. <Border
  592. x:Name="ReadModeContent"
  593. Grid.RowSpan="4"
  594. Height="44"
  595. Margin="0,0,0,5"
  596. HorizontalAlignment="Center"
  597. VerticalAlignment="Bottom"
  598. CornerRadius="4"
  599. MouseEnter="RectangleReadMode_MouseEnter"
  600. MouseLeave="ReadModeContent_MouseLeave"
  601. Visibility="Collapsed">
  602. <ContentControl prism:RegionManager.RegionName="{Binding ReadModeRegionName}" />
  603. </Border>
  604. <Rectangle
  605. x:Name="RectangleReadMode"
  606. Grid.RowSpan="4"
  607. Width="{Binding ActualWidth, ElementName=ReadModeContent, Mode=OneWay}"
  608. Height="44"
  609. Margin="0,0,0,5"
  610. HorizontalAlignment="Center"
  611. VerticalAlignment="Bottom"
  612. Fill="Transparent"
  613. MouseEnter="RectangleReadMode_MouseEnter"
  614. Visibility="Collapsed" />
  615. </Grid>
  616. </UserControl>