BOTAContent.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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:convert="clr-namespace:PDF_Office.DataConvert"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:prism="http://prismlibrary.com/"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. prism:ViewModelLocator.AutoWireViewModel="True"
  13. mc:Ignorable="d">
  14. <UserControl.Resources>
  15. <ResourceDictionary>
  16. <convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
  17. <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
  18. </ResourceDictionary>
  19. </UserControl.Resources>
  20. <Grid>
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition Width="48" />
  23. <ColumnDefinition />
  24. </Grid.ColumnDefinitions>
  25. <Border Background="Transparent">
  26. <Border.ContextMenu>
  27. <!-- CnotextMenu 不在视觉书树内,绑定其他控件名称需要用到x:Refrence -->
  28. <ContextMenu>
  29. <MenuItem
  30. Name="MenuThumbnail"
  31. Header="{Binding Source={x:Reference Name=TabItemThumbnail}, Path=Name}"
  32. IsCheckable="True"
  33. IsChecked="True" />
  34. <MenuItem
  35. Name="MenuOutLine"
  36. Header="{Binding Source={x:Reference Name=TabItemOutLine}, Path=Name}"
  37. IsCheckable="True"
  38. IsChecked="True" />
  39. <MenuItem
  40. Name="MenuBookMark"
  41. Header="{Binding Source={x:Reference Name=TabItemBookMark}, Path=Name}"
  42. IsCheckable="True"
  43. IsChecked="True" />
  44. <MenuItem
  45. Name="MenuAnnotation"
  46. Header="{Binding Source={x:Reference Name=TabItemAnnotation}, Path=Name}"
  47. IsCheckable="True"
  48. IsChecked="True" />
  49. <MenuItem
  50. Name="MenuSearch"
  51. Header="{Binding Source={x:Reference Name=TabItemSearch}, Path=Name}"
  52. IsCheckable="True"
  53. IsChecked="True" />
  54. <MenuItem
  55. Name="MenuFrom"
  56. Header="{Binding Source={x:Reference Name=TabItemForm}, Path=Name}"
  57. IsCheckable="True" />
  58. <MenuItem
  59. Name="MenuSign"
  60. Header="{Binding Source={x:Reference Name=TabItemSign}, Path=Name}"
  61. IsCheckable="True" />
  62. </ContextMenu>
  63. </Border.ContextMenu>
  64. </Border>
  65. <TabControl
  66. Grid.ColumnSpan="2"
  67. Background="Transparent"
  68. Style="{StaticResource TabControlWithUnderLineStyle}"
  69. TabStripPlacement="Left">
  70. <!-- 建立一个空的标头占位 -->
  71. <TabItem Height="0" />
  72. <TabItem
  73. Name="TabItemThumbnail"
  74. Width="48"
  75. Height="48"
  76. Header="缩略"
  77. Visibility="{Binding ElementName=MenuThumbnail, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  78. <TabItem
  79. Name="TabItemOutLine"
  80. Width="48"
  81. Height="48"
  82. Header="大纲"
  83. Visibility="{Binding ElementName=MenuOutLine, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  84. <TabItem
  85. Name="TabItemBookMark"
  86. Width="48"
  87. Height="48"
  88. Header="书签"
  89. Visibility="{Binding ElementName=MenuBookMark, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  90. <TabItem
  91. Name="TabItemAnnotation"
  92. Width="48"
  93. Height="48"
  94. Header="注释"
  95. Visibility="{Binding ElementName=MenuAnnotation, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  96. <TabItem
  97. Name="TabItemSearch"
  98. Width="48"
  99. Height="48"
  100. Header="搜索"
  101. Visibility="{Binding ElementName=MenuSearch, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  102. <TabItem
  103. Name="TabItemForm"
  104. Width="48"
  105. Height="48"
  106. Header="域"
  107. Visibility="{Binding ElementName=MenuFrom, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  108. <TabItem
  109. Name="TabItemSign"
  110. Width="48"
  111. Height="48"
  112. Header="签名"
  113. Visibility="{Binding ElementName=MenuSign, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
  114. </TabControl>
  115. </Grid>
  116. </UserControl>