ViewContent.xaml 30 KB

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