BOTAContent.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <UserControl
  2. x:Class="PDF_Master.Views.BOTA.BOTAContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:bota="clr-namespace:PDF_Master.ViewModels.BOTA"
  6. xmlns:convert="clr-namespace:PDF_Master.DataConvert"
  7. xmlns:customcontrol="clr-namespace:PDF_Master.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_Master.Views.BOTA"
  11. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  12. xmlns:prism="http://prismlibrary.com/"
  13. d:DataContext="{d:DesignInstance Type=bota:BOTAContentViewModel}"
  14. d:DesignHeight="450"
  15. d:DesignWidth="800"
  16. SizeChanged="UserControl_SizeChanged"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. mc:Ignorable="d">
  19. <UserControl.Resources>
  20. <ResourceDictionary>
  21. <convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
  22. <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
  23. </ResourceDictionary>
  24. </UserControl.Resources>
  25. <Grid Background="{StaticResource color.sys.layout.mg}">
  26. <Grid.ColumnDefinitions>
  27. <ColumnDefinition Width="48" />
  28. <ColumnDefinition />
  29. </Grid.ColumnDefinitions>
  30. <Border Background="Transparent">
  31. <Border.ContextMenu>
  32. <!-- CnotextMenu 不在视觉书树内,绑定其他控件名称需要用到x:Refrence -->
  33. <ContextMenu>
  34. <MenuItem
  35. Name="MenuThumbnail"
  36. Header="{Binding Source={x:Reference Name=TabItemThumbnail}, Path=Name}"
  37. IsCheckable="True"
  38. IsChecked="True"
  39. Unchecked="MenuThumbnail_Unchecked" />
  40. <MenuItem
  41. Name="MenuOutLine"
  42. Header="{Binding Source={x:Reference Name=TabItemOutLine}, Path=Name}"
  43. IsCheckable="True"
  44. IsChecked="True"
  45. Unchecked="MenuThumbnail_Unchecked" />
  46. <MenuItem
  47. Name="MenuBookMark"
  48. Header="{Binding Source={x:Reference Name=TabItemBookMark}, Path=Name}"
  49. IsCheckable="True"
  50. IsChecked="True"
  51. Unchecked="MenuThumbnail_Unchecked" />
  52. <MenuItem
  53. Name="MenuAnnotation"
  54. Header="{Binding Source={x:Reference Name=TabItemAnnotation}, Path=Name}"
  55. IsCheckable="True"
  56. IsChecked="True"
  57. Unchecked="MenuThumbnail_Unchecked" />
  58. <MenuItem
  59. Name="MenuSearch"
  60. Header="{Binding Source={x:Reference Name=TabItemSearch}, Path=Name}"
  61. IsCheckable="True"
  62. IsChecked="True"
  63. Unchecked="MenuThumbnail_Unchecked" />
  64. <MenuItem
  65. Name="MenuFrom"
  66. Header="{Binding Source={x:Reference Name=TabItemForm}, Path=Name}"
  67. IsCheckable="True"
  68. Unchecked="MenuThumbnail_Unchecked"
  69. Visibility="Collapsed" />
  70. <MenuItem
  71. Name="MenuSign"
  72. Header="{Binding Source={x:Reference Name=TabItemSign}, Path=Name}"
  73. IsCheckable="True"
  74. Unchecked="MenuThumbnail_Unchecked"
  75. Visibility="Collapsed" />
  76. </ContextMenu>
  77. </Border.ContextMenu>
  78. </Border>
  79. <TabControl
  80. Name="TabBOTA"
  81. Grid.ColumnSpan="2"
  82. Background="Transparent"
  83. SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
  84. Style="{StaticResource TabControlWithUnderLineStyle}"
  85. TabStripPlacement="Left">
  86. <TabControl.ItemContainerStyle>
  87. <Style BasedOn="{StaticResource BOTATab}" TargetType="{x:Type customcontrol:IconAndTextTabItem}">
  88. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="IconAndTextTabItem_PreviewMouseLeftButtonDown" />
  89. </Style>
  90. </TabControl.ItemContainerStyle>
  91. <!-- 建立一个空的标头占位 -->
  92. <customcontrol:IconAndTextTabItem
  93. Height="0"
  94. Margin="0"
  95. BorderThickness="0"
  96. IsSelected="True" />
  97. <customcontrol:IconAndTextTabItem
  98. x:Name="TabItemThumbnail"
  99. Width="48"
  100. Height="48"
  101. ToolTip="{Binding Tip_Thumbnail}"
  102. Visibility="{Binding ElementName=MenuThumbnail, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  103. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  104. <PathGeometry Figures="M15 9V17H5L5 3L9 3V7C9 8.10457 9.89543 9 11 9H15ZM14.1716 7H11V3.82843L12.5858 5.41421L14.1716 7ZM17 8V17C17 18.1046 16.1046 19 15 19H5C3.89543 19 3 18.1046 3 17V3C3 1.89543 3.89543 1 5 1H10H10.1716C10.702 1 11.2107 1.21071 11.5858 1.58579L14 4L16.4142 6.41421C16.7893 6.78929 17 7.29799 17 7.82843V8Z" />
  105. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  106. <customcontrol:IconAndTextTabItem.SelectedIcon>
  107. <PathGeometry Figures="M3 3C3 1.89543 3.89543 1 5 1H10.1716C10.702 1 11.2107 1.21071 11.5858 1.58579L14 4L16.4142 6.41421C16.7893 6.78929 17 7.29799 17 7.82843V17C17 18.1046 16.1046 19 15 19H5C3.89543 19 3 18.1046 3 17V3Z" />
  108. </customcontrol:IconAndTextTabItem.SelectedIcon>
  109. </customcontrol:IconAndTextTabItem>
  110. <customcontrol:IconAndTextTabItem
  111. x:Name="TabItemOutLine"
  112. Width="48"
  113. Height="48"
  114. Header="大纲"
  115. ToolTip="{Binding Tip_OutLine}"
  116. Visibility="{Binding ElementName=MenuOutLine, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  117. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  118. <PathGeometry Figures="M3 6H6V5C6 4.44772 6.44772 4 7 4H18C18.5523 4 19 4.44772 19 5V9C19 9.55228 18.5523 10 18 10H7C6.44772 10 6 9.55228 6 9V8H3V14L6 14V13C6 12.4477 6.44772 12 7 12H18C18.5523 12 19 12.4477 19 13V17C19 17.5523 18.5523 18 18 18H7C6.44772 18 6 17.5523 6 17V16H3C1.89543 16 1 15.1046 1 14V6V2H3V6ZM8 6V8H17V6H8ZM8 16V14H17V16H8Z" />
  119. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  120. <customcontrol:IconAndTextTabItem.SelectedIcon>
  121. <PathGeometry Figures="M3 6H6V5C6 4.44772 6.44772 4 7 4H18C18.5523 4 19 4.44772 19 5V9C19 9.55228 18.5523 10 18 10H7C6.44772 10 6 9.55228 6 9V8H3V14L6 14V13C6 12.4477 6.44772 12 7 12H18C18.5523 12 19 12.4477 19 13V17C19 17.5523 18.5523 18 18 18H7C6.44772 18 6 17.5523 6 17V16H3C1.89543 16 1 15.1046 1 14V6V2H3V6Z" />
  122. </customcontrol:IconAndTextTabItem.SelectedIcon>
  123. </customcontrol:IconAndTextTabItem>
  124. <customcontrol:IconAndTextTabItem
  125. x:Name="TabItemBookMark"
  126. Width="48"
  127. Height="48"
  128. Header="书签"
  129. ToolTip="{Binding Tip_BookMark}"
  130. Visibility="{Binding ElementName=MenuBookMark, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  131. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  132. <PathGeometry Figures="M11.3793 12.8851C10.6069 12.1494 9.3931 12.1494 8.62069 12.8851L5 16.3333V3H15V16.3333L11.3793 12.8851ZM15.3103 19.3908L10 14.3333L4.68966 19.3908C4.053 19.9971 3 19.5459 3 18.6667V3C3 1.89543 3.89543 1 5 1H15C16.1046 1 17 1.89543 17 3V18.6667C17 19.5459 15.947 19.9971 15.3103 19.3908ZM7 5H8H12H13V6V7H12H8H7V6V5Z" />
  133. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  134. <customcontrol:IconAndTextTabItem.SelectedIcon>
  135. <PathGeometry Figures="M3 3C3 1.89543 3.89543 1 5 1H15C16.1046 1 17 1.89543 17 3V18.6667C17 19.5459 15.947 19.9971 15.3103 19.3908L10 14.3333L4.68966 19.3908C4.053 19.9971 3 19.5459 3 18.6667V3Z" />
  136. </customcontrol:IconAndTextTabItem.SelectedIcon>
  137. </customcontrol:IconAndTextTabItem>
  138. <customcontrol:IconAndTextTabItem
  139. x:Name="TabItemAnnotation"
  140. Width="48"
  141. Height="48"
  142. Header="注释"
  143. ToolTip="{Binding Tip_Annote}"
  144. Visibility="{Binding ElementName=MenuAnnotation, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  145. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  146. <PathGeometry Figures="M3.5 1.5C2.39543 1.5 1.5 2.39543 1.5 3.5V16.5C1.5 17.6046 2.39543 18.5 3.5 18.5H16.5C17.6046 18.5 18.5 17.6046 18.5 16.5V3.5C18.5 2.39543 17.6046 1.5 16.5 1.5H3.5ZM8.06104 14H6.3584L9.04932 6.24951H10.9561L13.6523 14H11.9443L11.3696 12.1201H8.63574L8.06104 14ZM10.0537 7.79639H9.95703L9.00635 10.9062H10.999L10.0537 7.79639Z" />
  147. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  148. <customcontrol:IconAndTextTabItem.SelectedIcon>
  149. <PathGeometry Figures="M3.5 1.5C2.39543 1.5 1.5 2.39543 1.5 3.5V16.5C1.5 17.6046 2.39543 18.5 3.5 18.5H16.5C17.6046 18.5 18.5 17.6046 18.5 16.5V3.5C18.5 2.39543 17.6046 1.5 16.5 1.5H3.5ZM8.06104 14H6.3584L9.04932 6.24951H10.9561L13.6523 14H11.9443L11.3696 12.1201H8.63574L8.06104 14ZM10.0537 7.79639H9.95703L9.00635 10.9062H10.999L10.0537 7.79639Z" />
  150. </customcontrol:IconAndTextTabItem.SelectedIcon>
  151. </customcontrol:IconAndTextTabItem>
  152. <customcontrol:IconAndTextTabItem
  153. x:Name="TabItemSearch"
  154. Width="48"
  155. Height="48"
  156. Header="搜索"
  157. ToolTip="{Binding Tip_Search}"
  158. Visibility="{Binding ElementName=MenuSearch, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  159. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  160. <PathGeometry Figures="M14 8.5C14 11.5376 11.5376 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3C11.5376 3 14 5.46243 14 8.5ZM13.0492 14.4633C11.7874 15.4274 10.2106 16 8.5 16C4.35786 16 1 12.6421 1 8.5C1 4.35786 4.35786 1 8.5 1C12.6421 1 16 4.35786 16 8.5C16 10.2105 15.4274 11.7873 14.4634 13.0491L18.4572 17.0429L17.043 18.4571L13.0492 14.4633Z" />
  161. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  162. <customcontrol:IconAndTextTabItem.SelectedIcon>
  163. <PathGeometry Figures="M14 8.5C14 11.5376 11.5376 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3C11.5376 3 14 5.46243 14 8.5ZM13.0492 14.4633C11.7874 15.4274 10.2106 16 8.5 16C4.35786 16 1 12.6421 1 8.5C1 4.35786 4.35786 1 8.5 1C12.6421 1 16 4.35786 16 8.5C16 10.2105 15.4274 11.7873 14.4634 13.0491L18.4572 17.0429L17.043 18.4571L13.0492 14.4633Z" />
  164. </customcontrol:IconAndTextTabItem.SelectedIcon>
  165. </customcontrol:IconAndTextTabItem>
  166. <customcontrol:IconAndTextTabItem
  167. x:Name="TabItemForm"
  168. Width="48"
  169. Height="48"
  170. Header="域"
  171. Visibility="{Binding ElementName=MenuFrom, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  172. <customcontrol:IconAndTextTabItem
  173. x:Name="TabItemSign"
  174. Width="48"
  175. Height="48"
  176. Header="签名"
  177. Visibility="{Binding ElementName=MenuSign, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  178. <i:Interaction.Triggers>
  179. <i:EventTrigger EventName="SelectionChanged">
  180. <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
  181. </i:EventTrigger>
  182. </i:Interaction.Triggers>
  183. </TabControl>
  184. <Border
  185. Grid.Column="1"
  186. BorderBrush="{StaticResource color.sys.border.neutral.lv3}"
  187. BorderThickness="1,0">
  188. <ContentControl prism:RegionManager.RegionName="{Binding BOTAContentRegionName}" />
  189. </Border>
  190. </Grid>
  191. </UserControl>