<UserControl
    x:Class="PDF_Office.Views.BOTA.BOTAContent"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:bota="clr-namespace:PDF_Office.ViewModels.BOTA"
    xmlns:convert="clr-namespace:PDF_Office.DataConvert"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
    xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:prism="http://prismlibrary.com/"
    d:DataContext="{d:DesignInstance Type=bota:BOTAContentViewModel}"
    d:DesignHeight="450"
    d:DesignWidth="800"
    prism:ViewModelLocator.AutoWireViewModel="True"
    mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
            <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="48" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Border Background="Transparent">
            <Border.ContextMenu>
                <!--  CnotextMenu 不在视觉书树内，绑定其他控件名称需要用到x:Refrence  -->
                <ContextMenu>
                    <MenuItem
                        Name="MenuThumbnail"
                        Header="{Binding Source={x:Reference Name=TabItemThumbnail}, Path=Name}"
                        IsCheckable="True"
                        IsChecked="True" />
                    <MenuItem
                        Name="MenuOutLine"
                        Header="{Binding Source={x:Reference Name=TabItemOutLine}, Path=Name}"
                        IsCheckable="True"
                        IsChecked="True" />
                    <MenuItem
                        Name="MenuBookMark"
                        Header="{Binding Source={x:Reference Name=TabItemBookMark}, Path=Name}"
                        IsCheckable="True"
                        IsChecked="True" />
                    <MenuItem
                        Name="MenuAnnotation"
                        Header="{Binding Source={x:Reference Name=TabItemAnnotation}, Path=Name}"
                        IsCheckable="True"
                        IsChecked="True" />
                    <MenuItem
                        Name="MenuSearch"
                        Header="{Binding Source={x:Reference Name=TabItemSearch}, Path=Name}"
                        IsCheckable="True"
                        IsChecked="True" />
                    <MenuItem
                        Name="MenuFrom"
                        Header="{Binding Source={x:Reference Name=TabItemForm}, Path=Name}"
                        IsCheckable="True" />
                    <MenuItem
                        Name="MenuSign"
                        Header="{Binding Source={x:Reference Name=TabItemSign}, Path=Name}"
                        IsCheckable="True" />
                </ContextMenu>
            </Border.ContextMenu>
        </Border>
        <TabControl
            Grid.ColumnSpan="2"
            Background="Transparent"
            Style="{StaticResource TabControlWithUnderLineStyle}"
            TabStripPlacement="Left">

            <!--  建立一个空的标头占位  -->
            <TabItem
                Height="0"
                Margin="0"
                BorderThickness="0" />
            <TabItem
                Name="TabItemThumbnail"
                Width="48"
                Height="48"
                Header="缩略"
                Visibility="{Binding ElementName=MenuThumbnail, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
            <TabItem
                Name="TabItemOutLine"
                Width="48"
                Height="48"
                Header="大纲"
                Visibility="{Binding ElementName=MenuOutLine, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
            <TabItem
                Name="TabItemBookMark"
                Width="48"
                Height="48"
                Header="书签"
                Visibility="{Binding ElementName=MenuBookMark, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
            <TabItem
                Name="TabItemAnnotation"
                Width="48"
                Height="48"
                Header="注释"
                Visibility="{Binding ElementName=MenuAnnotation, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
            <TabItem
                Name="TabItemSearch"
                Width="48"
                Height="48"
                Header="搜索"
                Visibility="{Binding ElementName=MenuSearch, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
            <TabItem
                Name="TabItemForm"
                Width="48"
                Height="48"
                Header="域"
                Visibility="{Binding ElementName=MenuFrom, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
            <TabItem
                Name="TabItemSign"
                Width="48"
                Height="48"
                Header="签名"
                Visibility="{Binding ElementName=MenuSign, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </TabControl>
        <ContentControl Grid.Column="1" prism:RegionManager.RegionName="{Binding BOTAContentRegionName}" />
    </Grid>
</UserControl>