ViewContent.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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:cus="clr-namespace:PDF_Office.CustomControl"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:local="clr-namespace:PDF_Office.Views"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:prism="http://prismlibrary.com/"
  12. xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
  13. d:DataContext="{d:DesignInstance Type=viewmodels:ViewContentViewModel}"
  14. d:DesignHeight="450"
  15. d:DesignWidth="800"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. mc:Ignorable="d">
  18. <i:Interaction.Triggers>
  19. <i:EventTrigger EventName="Loaded">
  20. <prism:InvokeCommandAction Command="{Binding Load}" />
  21. </i:EventTrigger>
  22. </i:Interaction.Triggers>
  23. <UserControl.Resources>
  24. <ResourceDictionary>
  25. <Style x:Key="MenuButtonStyle" TargetType="{x:Type Button}">
  26. <Setter Property="Width" Value="20" />
  27. <Setter Property="Height" Value="20" />
  28. </Style>
  29. </ResourceDictionary>
  30. </UserControl.Resources>
  31. <Grid>
  32. <Grid.RowDefinitions>
  33. <RowDefinition Name="HeadRow" Height="40" />
  34. <RowDefinition Name="ToolRow" Height="40" />
  35. <RowDefinition Height="*" />
  36. <RowDefinition Height="32" />
  37. </Grid.RowDefinitions>
  38. <!-- 左边菜单按钮 -->
  39. <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
  40. <Button
  41. Margin="8"
  42. Style="{StaticResource MenuButtonStyle}"
  43. ToolTip="File">
  44. <Path Data="M12.6172 12L15.8906 5.44531C15.9635 5.29948 16 5.14844 16 4.99219C16 4.85677 15.974 4.72917 15.9219 4.60938C15.8698 4.48958 15.7982 4.38411 15.707 4.29297C15.6159 4.20182 15.5091 4.13021 15.3867 4.07812C15.2643 4.02604 15.1354 4 15 4H13V2C13 1.85938 12.974 1.72917 12.9219 1.60938C12.8698 1.48958 12.7982 1.38411 12.707 1.29297C12.6159 1.20182 12.5104 1.13021 12.3906 1.07812C12.2708 1.02604 12.1406 1 12 1H6.25C6.08854 1 5.94661 0.97526 5.82422 0.925781C5.70182 0.876302 5.58724 0.815104 5.48047 0.742188C5.3737 0.669271 5.26823 0.588542 5.16406 0.5C5.0599 0.411458 4.94141 0.330729 4.80859 0.257812C4.67578 0.184896 4.52474 0.123698 4.35547 0.0742188C4.1862 0.0247396 3.98438 0 3.75 0H1C0.859375 0 0.729167 0.0260417 0.609375 0.078125C0.489583 0.130208 0.384115 0.201823 0.292969 0.292969C0.201823 0.384115 0.130208 0.489583 0.078125 0.609375C0.0260417 0.729167 0 0.859375 0 1V12H12.6172ZM1 9.38281V1H3.75C3.91146 1 4.05339 1.02474 4.17578 1.07422C4.29818 1.1237 4.41276 1.1849 4.51953 1.25781C4.6263 1.33073 4.73177 1.41146 4.83594 1.5C4.9401 1.58854 5.05859 1.66927 5.19141 1.74219C5.32422 1.8151 5.47526 1.8763 5.64453 1.92578C5.8138 1.97526 6.01562 2 6.25 2H12V4H4.3125C4.11979 4 3.94401 4.04948 3.78516 4.14844C3.6263 4.2474 3.5026 4.38281 3.41406 4.55469L1 9.38281ZM1.3125 11H12L15 5H4.3125L1.3125 11Z" Fill="#333333" />
  45. </Button>
  46. <Button
  47. Margin="8"
  48. Command="{Binding SaveFile}"
  49. IsEnabled="{Binding CanSave}"
  50. Style="{StaticResource MenuButtonStyle}"
  51. ToolTip="Save">
  52. <Path Data="M0 0H10.7071L14 3.29289V14H0V0ZM13 3.707L10.293 1H1V13H3V7H11V13H13V3.707ZM10 13H4V8H10V13ZM6 5V4H3V5H6Z" Fill="#333333" />
  53. </Button>
  54. <Button
  55. Margin="8"
  56. Command="{Binding UndoCommand}"
  57. IsEnabled="{Binding CanUndo}"
  58. Style="{StaticResource MenuButtonStyle}"
  59. ToolTip="Undo">
  60. <Path Data="M3.02773 1.12105L2 1.1197L2.00703 6.05868L7.14571 6.06544L7.1443 5.07764L3.95607 5.07345L5.96547 3.14214L6.1139 3.0063C7.72531 1.60263 10.2166 1.64791 11.7713 3.14214C13.3745 4.68306 13.3745 7.18139 11.7713 8.72231L5.96547 14.3025L6.69119 15L12.497 9.41983L12.651 9.26532C14.4996 7.33014 14.4483 4.32008 12.497 2.44461C10.4929 0.518462 7.24377 0.518462 5.23974 2.44461L3.03264 4.56595L3.02773 1.12105Z" Fill="#333333" />
  61. </Button>
  62. <Button
  63. Margin="8"
  64. Command="{Binding RedoCommand}"
  65. IsEnabled="{Binding CanRedo}"
  66. Style="{StaticResource MenuButtonStyle}"
  67. ToolTip="Redo">
  68. <Path Data="M10.9737 0.118216L12 0.116865L11.993 5.05009L6.86172 5.05685L6.86312 4.0702L10.0425 4.06602L8.03792 2.13876L7.88969 2.00309C6.28039 0.601253 3.78921 0.649819 2.23256 2.1464C0.627259 3.68974 0.623702 6.18858 2.22461 7.72771L8.02203 13.3014L7.29536 14L1.49795 8.42633L1.34413 8.27199C-0.501568 6.33885 -0.445937 3.3281 1.50788 1.44969C3.51451 -0.479494 6.76344 -0.483769 8.76458 1.44014L10.9688 3.55934L10.9737 0.118216Z" Fill="#333333" />
  69. </Button>
  70. </StackPanel>
  71. <!-- 右边菜单按钮 -->
  72. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  73. <Button
  74. Margin="8"
  75. Style="{StaticResource MenuButtonStyle}"
  76. ToolTip="Print">
  77. <Path Data="M12 6V0H4V6H1.5L1.35554 6.00687C0.594888 6.07955 0 6.7203 0 7.5V14H4V16H12V14H16V7.5L15.9931 7.35554C15.9204 6.59489 15.2797 6 14.5 6H12ZM4 10V13H1V7.5L1.00806 7.41012C1.05039 7.17688 1.25454 7 1.5 7H14.5L14.5899 7.00806C14.8231 7.05039 15 7.25454 15 7.5V13H12V10H4ZM11 6V1H5V6H11ZM11 11H5V15H11V11ZM3 8H2V9H3V8Z" Fill="#333333" />
  78. </Button>
  79. <Button
  80. Margin="8"
  81. Style="{StaticResource MenuButtonStyle}"
  82. ToolTip="Share">
  83. <Path Data="M10 11L15.5 5.5L10 0V3C9.35417 3 8.73307 3.08333 8.13672 3.25C7.54036 3.41667 6.98307 3.65234 6.46484 3.95703C5.94661 4.26172 5.47526 4.6263 5.05078 5.05078C4.6263 5.47526 4.26172 5.94661 3.95703 6.46484C3.65234 6.98307 3.41667 7.54036 3.25 8.13672C3.08333 8.73307 3 9.35417 3 10V11C3.45833 10.526 3.95703 10.1029 4.49609 9.73047C5.03516 9.35807 5.60156 9.04297 6.19531 8.78516C6.78906 8.52734 7.40495 8.33203 8.04297 8.19922C8.68099 8.06641 9.33333 8 10 8V11ZM4.125 8.76562C4.22396 8.28646 4.37891 7.82943 4.58984 7.39453C4.80078 6.95964 5.05859 6.55599 5.36328 6.18359C5.66797 5.8112 6.01432 5.47917 6.40234 5.1875C6.79036 4.89583 7.21094 4.65625 7.66406 4.46875C7.96094 4.34375 8.24219 4.2487 8.50781 4.18359C8.77344 4.11849 9.03776 4.07292 9.30078 4.04688C9.5638 4.02083 9.72396 4.00651 10 4.00391C10.276 4.0013 10.6823 4 11 4V2.41406L14 5.5L11 8.5V7H10C8.94792 7 7.92448 7.14844 6.92969 7.44531C5.9349 7.74219 5 8.18229 4.125 8.76562ZM1 14V4H0V15H16V12H15V14H1Z" Fill="#333333" />
  84. </Button>
  85. <Button
  86. Margin="8"
  87. Style="{StaticResource MenuButtonStyle}"
  88. ToolTip="Property" />
  89. </StackPanel>
  90. <TabControl
  91. x:Name="ToolTabControl"
  92. Grid.Row="0"
  93. Grid.RowSpan="2"
  94. HorizontalAlignment="Center"
  95. VerticalAlignment="Top"
  96. BorderThickness="0"
  97. Style="{StaticResource TabControlWithUnderLineStyle}">
  98. <cus:IconAndTextTabItem
  99. x:Name="TabItemAnnotation"
  100. Header="注释"
  101. Style="{StaticResource TabItem_WithUnderLineStyle}">
  102. <Grid Grid.Row="1" Height="40" />
  103. </cus:IconAndTextTabItem>
  104. <cus:IconAndTextTabItem
  105. x:Name="TabItemPageEdit"
  106. Header="页面"
  107. Style="{StaticResource TabItem_WithUnderLineStyle}" />
  108. <cus:IconAndTextTabItem
  109. x:Name="TabItemConvert"
  110. Header="转换"
  111. Style="{StaticResource TabItem_WithUnderLineStyle}" />
  112. <cus:IconAndTextTabItem
  113. x:Name="TabItemScan"
  114. Header="扫描和OCR"
  115. Style="{StaticResource TabItem_WithUnderLineStyle}">
  116. <Grid Grid.Row="1" Height="40" />
  117. </cus:IconAndTextTabItem>
  118. <cus:IconAndTextTabItem
  119. x:Name="TabItemEdit"
  120. Height="40"
  121. Header="编辑"
  122. Style="{StaticResource TabItem_WithUnderLineStyle}">
  123. <Grid Grid.Row="1" Height="40" />
  124. </cus:IconAndTextTabItem>
  125. <cus:IconAndTextTabItem
  126. x:Name="TabItemForm"
  127. Height="40"
  128. Header="表单"
  129. Style="{StaticResource TabItem_WithUnderLineStyle}">
  130. <Grid Grid.Row="1" Height="40" />
  131. </cus:IconAndTextTabItem>
  132. <cus:IconAndTextTabItem
  133. x:Name="TabItemFill"
  134. Height="40"
  135. Header="填写与签名"
  136. Style="{StaticResource TabItem_WithUnderLineStyle}">
  137. <Grid Grid.Row="1" Height="40" />
  138. </cus:IconAndTextTabItem>
  139. <cus:IconAndTextTabItem
  140. x:Name="TabItemTool"
  141. Height="40"
  142. Header="工具"
  143. Style="{StaticResource TabItem_WithUnderLineStyle}">
  144. <Grid Grid.Row="1" Height="40" />
  145. </cus:IconAndTextTabItem>
  146. <i:Interaction.Triggers>
  147. <i:EventTrigger EventName="SelectionChanged">
  148. <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
  149. </i:EventTrigger>
  150. </i:Interaction.Triggers>
  151. </TabControl>
  152. <Grid Name="DocumentView" Grid.Row="2">
  153. <Grid.ColumnDefinitions>
  154. <ColumnDefinition
  155. x:Name="BOTACloumn"
  156. Width="48"
  157. MinWidth="48"
  158. MaxWidth="400" />
  159. <ColumnDefinition Width="12" />
  160. <ColumnDefinition
  161. Name="ViewerColumn"
  162. Width="*"
  163. MinWidth="200" />
  164. <ColumnDefinition Width="12" />
  165. <ColumnDefinition Name="PropertyColumn" Width="0" />
  166. </Grid.ColumnDefinitions>
  167. <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" />
  168. <GridSplitter
  169. Grid.Column="1"
  170. Width="12"
  171. FocusVisualStyle="{x:Null}"
  172. ResizeBehavior="PreviousAndNext"
  173. ShowsPreview="True" />
  174. <ContentControl
  175. x:Name="PDFViewerContent"
  176. Grid.Column="2"
  177. HorizontalAlignment="Stretch"
  178. prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
  179. <Button Grid.Column="3" />
  180. <ContentControl Grid.Column="4" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
  181. </Grid>
  182. <local:BottomToolContent Grid.Row="3" />
  183. <!-- 用于显示页面编辑、水印、背景、标记密文等功能的区域 -->
  184. <ContentControl
  185. Name="ContentTool"
  186. Grid.Row="{Binding GridToolRow}"
  187. Grid.RowSpan="{Binding GridToolRowSpan}"
  188. prism:RegionManager.RegionName="{Binding ToolContentRegionName}"
  189. Visibility="{Binding ToolContentVisible}" />
  190. <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
  191. <ContentControl
  192. Name="ContentToolsBar"
  193. Grid.Row="{Binding GridToolRow}"
  194. prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
  195. Visibility="{Binding ToolsBarContentVisible}" />
  196. </Grid>
  197. </UserControl>