ViewContent.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:local="clr-namespace:PDF_Office.Views"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:prism="http://prismlibrary.com/"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. prism:ViewModelLocator.AutoWireViewModel="True"
  14. mc:Ignorable="d">
  15. <UserControl.Resources>
  16. <ResourceDictionary>
  17. <Style x:Key="TabControlWithUnderLineStyle" TargetType="{x:Type TabControl}">
  18. <Setter Property="Padding" Value="2" />
  19. <Setter Property="HorizontalContentAlignment" Value="Center" />
  20. <Setter Property="VerticalContentAlignment" Value="Center" />
  21. <Setter Property="Background" Value="Transparent" />
  22. <Setter Property="BorderBrush" Value="#FFACACAC" />
  23. <Setter Property="BorderThickness" Value="0,0,0,1" />
  24. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  25. <Setter Property="Template">
  26. <Setter.Value>
  27. <ControlTemplate TargetType="{x:Type TabControl}">
  28. <Grid
  29. x:Name="templateRoot"
  30. ClipToBounds="True"
  31. KeyboardNavigation.TabNavigation="Local"
  32. SnapsToDevicePixels="True">
  33. <Grid.ColumnDefinitions>
  34. <ColumnDefinition x:Name="ColumnDefinition0" />
  35. <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
  36. </Grid.ColumnDefinitions>
  37. <Grid.RowDefinitions>
  38. <RowDefinition x:Name="RowDefinition0" Height="Auto" />
  39. <RowDefinition x:Name="RowDefinition1" Height="*" />
  40. </Grid.RowDefinitions>
  41. <!-- 加滑轨配合滑轨样式可实现箭头左右滚动的菜单栏 -->
  42. <!--<ScrollViewer Margin="140 0 140 0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">-->
  43. <TabPanel
  44. x:Name="HeaderPanel"
  45. Grid.Row="0"
  46. Grid.Column="0"
  47. Margin="30,0"
  48. HorizontalAlignment="Center"
  49. Panel.ZIndex="1"
  50. Background="Transparent"
  51. IsItemsHost="True"
  52. KeyboardNavigation.TabIndex="1" />
  53. <!--</ScrollViewer>-->
  54. <!-- 页头和中间内容的分割线 -->
  55. <Line
  56. Margin="0,0,0,1"
  57. VerticalAlignment="Bottom"
  58. SnapsToDevicePixels="True"
  59. Stroke="Transparent"
  60. StrokeThickness="0.1"
  61. X1="0"
  62. X2="{Binding ActualWidth, RelativeSource={RelativeSource Self}}" />
  63. <Border
  64. x:Name="ContentPanel"
  65. Grid.Row="1"
  66. Grid.Column="0"
  67. Background="{TemplateBinding Background}"
  68. BorderBrush="{TemplateBinding BorderBrush}"
  69. BorderThickness="{TemplateBinding BorderThickness}"
  70. KeyboardNavigation.DirectionalNavigation="Contained"
  71. KeyboardNavigation.TabIndex="2"
  72. KeyboardNavigation.TabNavigation="Local">
  73. <ContentPresenter
  74. x:Name="PART_SelectedContentHost"
  75. Margin="0"
  76. Content="{TemplateBinding SelectedContent}"
  77. ContentSource="SelectedContent"
  78. ContentStringFormat="{TemplateBinding SelectedContentStringFormat}"
  79. ContentTemplate="{TemplateBinding SelectedContentTemplate}"
  80. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  81. </Border>
  82. </Grid>
  83. <ControlTemplate.Triggers>
  84. <Trigger Property="TabStripPlacement" Value="Bottom">
  85. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="1" />
  86. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  87. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  88. <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
  89. </Trigger>
  90. <Trigger Property="TabStripPlacement" Value="Left">
  91. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
  92. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  93. <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="0" />
  94. <Setter TargetName="ContentPanel" Property="Grid.Column" Value="1" />
  95. <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
  96. <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
  97. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  98. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  99. </Trigger>
  100. <Trigger Property="TabStripPlacement" Value="Right">
  101. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
  102. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  103. <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="1" />
  104. <Setter TargetName="ContentPanel" Property="Grid.Column" Value="0" />
  105. <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
  106. <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
  107. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  108. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  109. </Trigger>
  110. <Trigger Property="IsEnabled" Value="False">
  111. <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  112. </Trigger>
  113. </ControlTemplate.Triggers>
  114. </ControlTemplate>
  115. </Setter.Value>
  116. </Setter>
  117. <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
  118. <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
  119. </Style>
  120. </ResourceDictionary>
  121. </UserControl.Resources>
  122. <Grid>
  123. <Grid.RowDefinitions>
  124. <RowDefinition Name="HeadRow" Height="40" />
  125. <RowDefinition Name="ToolRow" Height="40" />
  126. <RowDefinition Height="*" />
  127. <RowDefinition Height="24" />
  128. </Grid.RowDefinitions>
  129. <!-- 左边菜单按钮 -->
  130. <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
  131. <Button
  132. Width="16"
  133. Height="16"
  134. Margin="8"
  135. ToolTip="File" />
  136. <Button
  137. Width="16"
  138. Height="16"
  139. Margin="8"
  140. ToolTip="Save" />
  141. <Button
  142. Width="16"
  143. Height="16"
  144. Margin="8"
  145. ToolTip="Undo" />
  146. <Button
  147. Width="16"
  148. Height="16"
  149. Margin="8"
  150. ToolTip="Redo" />
  151. </StackPanel>
  152. <!-- 右边菜单按钮 -->
  153. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  154. <Button
  155. Width="16"
  156. Height="16"
  157. Margin="8"
  158. ToolTip="Print" />
  159. <Button
  160. Width="16"
  161. Height="16"
  162. Margin="8"
  163. ToolTip="Share" />
  164. <Button
  165. Width="16"
  166. Height="16"
  167. Margin="8"
  168. ToolTip="Property" />
  169. </StackPanel>
  170. <TabControl
  171. x:Name="ToolTabControl"
  172. Grid.Row="0"
  173. Grid.RowSpan="2"
  174. VerticalAlignment="Top"
  175. BorderThickness="0"
  176. Style="{StaticResource TabControlWithUnderLineStyle}">
  177. <TabItem Height="40" Header="注释">
  178. <Grid Grid.Row="1" Height="40" />
  179. </TabItem>
  180. <TabItem Header="页面" />
  181. <TabItem Header="转换" />
  182. <TabItem Header="扫描和OCR">
  183. <Grid Grid.Row="1" Height="40" />
  184. </TabItem>
  185. <TabItem Height="40" Header="编辑">
  186. <Grid Grid.Row="1" Height="40" />
  187. </TabItem>
  188. <TabItem Height="40" Header="表单">
  189. <Grid Grid.Row="1" Height="40" />
  190. </TabItem>
  191. <TabItem Height="40" Header="填写与签名">
  192. <Grid Grid.Row="1" Height="40" />
  193. </TabItem>
  194. <TabItem Height="40" Header="工具">
  195. <Grid Grid.Row="1" Height="40" />
  196. </TabItem>
  197. </TabControl>
  198. <Grid Name="DocumentView" Grid.Row="2">
  199. <Grid.ColumnDefinitions>
  200. <ColumnDefinition
  201. x:Name="BOTACloumn"
  202. Width="48"
  203. MinWidth="48"
  204. MaxWidth="400" />
  205. <ColumnDefinition Width="12" />
  206. <ColumnDefinition
  207. Name="ViewerColumn"
  208. Width="*"
  209. MinWidth="200" />
  210. <ColumnDefinition Width="12" />
  211. <ColumnDefinition Name="PropertyColumn" Width="0" />
  212. </Grid.ColumnDefinitions>
  213. <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" />
  214. <GridSplitter
  215. Grid.Column="1"
  216. Width="12"
  217. FocusVisualStyle="{x:Null}"
  218. ResizeBehavior="PreviousAndNext"
  219. ShowsPreview="True" />
  220. <ContentControl
  221. x:Name="PDFViewerContent"
  222. Grid.Column="2"
  223. HorizontalAlignment="Stretch"
  224. prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
  225. <Button Grid.Column="3" />
  226. <ContentControl Grid.Column="4" prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
  227. </Grid>
  228. <local:BottomToolContent Grid.Row="3" />
  229. <ContentControl
  230. Grid.Row="2"
  231. Grid.RowSpan="2"
  232. Visibility="Collapsed">
  233. <Grid Background="Red" />
  234. </ContentControl>
  235. </Grid>
  236. </UserControl>