BOTAContent.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <UserControl
  2. x:Class="PDF_Office.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_Office.ViewModels.BOTA"
  6. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:customcontrol="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.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. prism:ViewModelLocator.AutoWireViewModel="True"
  17. mc:Ignorable="d">
  18. <UserControl.Resources>
  19. <ResourceDictionary>
  20. <convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
  21. <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
  22. </ResourceDictionary>
  23. </UserControl.Resources>
  24. <Grid Background="{StaticResource color.sys.layout.mg}">
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="48" />
  27. <ColumnDefinition />
  28. </Grid.ColumnDefinitions>
  29. <Border Background="Transparent">
  30. <Border.ContextMenu>
  31. <!-- CnotextMenu 不在视觉书树内,绑定其他控件名称需要用到x:Refrence -->
  32. <ContextMenu>
  33. <MenuItem
  34. Name="MenuThumbnail"
  35. Header="{Binding Source={x:Reference Name=TabItemThumbnail}, Path=Name}"
  36. IsCheckable="True"
  37. IsChecked="True" />
  38. <MenuItem
  39. Name="MenuOutLine"
  40. Header="{Binding Source={x:Reference Name=TabItemOutLine}, Path=Name}"
  41. IsCheckable="True"
  42. IsChecked="True" />
  43. <MenuItem
  44. Name="MenuBookMark"
  45. Header="{Binding Source={x:Reference Name=TabItemBookMark}, Path=Name}"
  46. IsCheckable="True"
  47. IsChecked="True" />
  48. <MenuItem
  49. Name="MenuAnnotation"
  50. Header="{Binding Source={x:Reference Name=TabItemAnnotation}, Path=Name}"
  51. IsCheckable="True"
  52. IsChecked="True" />
  53. <MenuItem
  54. Name="MenuSearch"
  55. Header="{Binding Source={x:Reference Name=TabItemSearch}, Path=Name}"
  56. IsCheckable="True"
  57. IsChecked="True" />
  58. <MenuItem
  59. Name="MenuFrom"
  60. Header="{Binding Source={x:Reference Name=TabItemForm}, Path=Name}"
  61. IsCheckable="True"
  62. Visibility="Collapsed" />
  63. <MenuItem
  64. Name="MenuSign"
  65. Header="{Binding Source={x:Reference Name=TabItemSign}, Path=Name}"
  66. IsCheckable="True"
  67. Visibility="Collapsed" />
  68. </ContextMenu>
  69. </Border.ContextMenu>
  70. </Border>
  71. <TabControl
  72. Name="TabBOTA"
  73. Grid.ColumnSpan="2"
  74. Background="Transparent"
  75. PreviewMouseLeftButtonDown="TabControl_PreviewMouseLeftButtonDown"
  76. SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
  77. Style="{StaticResource TabControlWithUnderLineStyle}"
  78. TabStripPlacement="Left">
  79. <!-- 建立一个空的标头占位 -->
  80. <customcontrol:IconAndTextTabItem
  81. Height="0"
  82. Margin="0"
  83. BorderThickness="0"
  84. IsSelected="True"
  85. Style="{StaticResource BOTATab}" />
  86. <customcontrol:IconAndTextTabItem
  87. x:Name="TabItemThumbnail"
  88. Width="48"
  89. Height="48"
  90. Style="{StaticResource BOTATab}"
  91. Visibility="{Binding ElementName=MenuThumbnail, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  92. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  93. <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" />
  94. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  95. <customcontrol:IconAndTextTabItem.SelectedIcon>
  96. <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" />
  97. </customcontrol:IconAndTextTabItem.SelectedIcon>
  98. </customcontrol:IconAndTextTabItem>
  99. <customcontrol:IconAndTextTabItem
  100. x:Name="TabItemOutLine"
  101. Width="48"
  102. Height="48"
  103. Header="大纲"
  104. Style="{StaticResource BOTATab}"
  105. Visibility="{Binding ElementName=MenuOutLine, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  106. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  107. <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" />
  108. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  109. <customcontrol:IconAndTextTabItem.SelectedIcon>
  110. <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" />
  111. </customcontrol:IconAndTextTabItem.SelectedIcon>
  112. </customcontrol:IconAndTextTabItem>
  113. <customcontrol:IconAndTextTabItem
  114. x:Name="TabItemBookMark"
  115. Width="48"
  116. Height="48"
  117. Header="书签"
  118. Style="{StaticResource BOTATab}"
  119. Visibility="{Binding ElementName=MenuBookMark, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  120. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  121. <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" />
  122. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  123. <customcontrol:IconAndTextTabItem.SelectedIcon>
  124. <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" />
  125. </customcontrol:IconAndTextTabItem.SelectedIcon>
  126. </customcontrol:IconAndTextTabItem>
  127. <customcontrol:IconAndTextTabItem
  128. x:Name="TabItemAnnotation"
  129. Width="48"
  130. Height="48"
  131. Header="注释"
  132. Style="{StaticResource BOTATab}"
  133. Visibility="{Binding ElementName=MenuAnnotation, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  134. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  135. <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" />
  136. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  137. <customcontrol:IconAndTextTabItem.SelectedIcon>
  138. <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" />
  139. </customcontrol:IconAndTextTabItem.SelectedIcon>
  140. </customcontrol:IconAndTextTabItem>
  141. <customcontrol:IconAndTextTabItem
  142. x:Name="TabItemSearch"
  143. Width="48"
  144. Height="48"
  145. Header="搜索"
  146. Style="{StaticResource BOTATab}"
  147. Visibility="{Binding ElementName=MenuSearch, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}">
  148. <customcontrol:IconAndTextTabItem.NormalPathIcon>
  149. <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" />
  150. </customcontrol:IconAndTextTabItem.NormalPathIcon>
  151. <customcontrol:IconAndTextTabItem.SelectedIcon>
  152. <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" />
  153. </customcontrol:IconAndTextTabItem.SelectedIcon>
  154. </customcontrol:IconAndTextTabItem>
  155. <customcontrol:IconAndTextTabItem
  156. x:Name="TabItemForm"
  157. Width="48"
  158. Height="48"
  159. Header="域"
  160. Style="{StaticResource BOTATab}"
  161. Visibility="{Binding ElementName=MenuFrom, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  162. <customcontrol:IconAndTextTabItem
  163. x:Name="TabItemSign"
  164. Width="48"
  165. Height="48"
  166. Header="签名"
  167. Style="{StaticResource BOTATab}"
  168. Visibility="{Binding ElementName=MenuSign, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  169. <i:Interaction.Triggers>
  170. <i:EventTrigger EventName="SelectionChanged">
  171. <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
  172. </i:EventTrigger>
  173. </i:Interaction.Triggers>
  174. </TabControl>
  175. <Border
  176. Grid.Column="1"
  177. BorderBrush="{StaticResource color.sys.border.neutral.lv3}"
  178. BorderThickness="1,0">
  179. <ContentControl prism:RegionManager.RegionName="{Binding BOTAContentRegionName}" />
  180. </Border>
  181. </Grid>
  182. </UserControl>