alielie
2025-03-03 1fca2167068e9ef2c079ec742f20313fc6697ab1
WPFProject/Controls/MainTabControl.xaml
@@ -13,29 +13,33 @@
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="ListBox" x:Key="ListBoxItemStyle1">
                <Setter Property="Background" Value="{StaticResource MainMenu}"/>
                <Setter Property="Background" Value="{StaticResource PrimaryColor}"/>
                <Setter Property="ItemContainerStyle">
                    <Setter.Value>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="Margin" Value="0"/>
                            <Setter Property="Padding" Value="0"/>
                            <Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="ListBoxItem">
                                        <Border x:Name="border" Background="{StaticResource MainMenu}"
                                                Padding="10" Margin="0" BorderThickness="0,0,1,0" BorderBrush="Gray">
                                        <Border x:Name="border" Background="{StaticResource PrimaryColor}"
                                                Padding="10" Margin="0" BorderThickness="0,0,1,1"
                                                BorderBrush="Gray">
                                            <!-- 内容呈现器 -->
                                            <StackPanel>
                                                <ContentPresenter  Content="{TemplateBinding Content}"
                                                <ContentPresenter x:Name="cp" Content="{TemplateBinding Content}"
                                                                   ContentStringFormat="{TemplateBinding ContentStringFormat}" 
                                                                   ContentTemplate="{TemplateBinding ContentTemplate}"  />
                                            </StackPanel>
                                        </Border>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsSelected" Value="True">
                                                <Setter TargetName="border" Property="Background" Value="{StaticResource ButtonSelected}" />
                                                <Setter TargetName="border" Property="Background"
                                                        Value="{StaticResource WorkspaceBackground}"/>
                                                <Setter Property="Foreground" Value="{StaticResource PrimaryColor}"/>
                                                <Setter TargetName="border" Property="BorderThickness" Value="0,0,0,0"/>
                                            </Trigger>
                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=(ItemsControl.AlternationIndex)}" Value="0">
@@ -43,7 +47,8 @@
                                            </DataTrigger>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter TargetName="border" Property="Background" Value="Red" />
                                                <Setter TargetName="border" Property="Background" Value="{StaticResource SecondPrimaryColor}" />
                                                <Setter Property="Foreground" Value="{StaticResource SecondPrimaryColorContract}" />
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
@@ -64,8 +69,8 @@
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
                                <Image Width="20" Height="20" Margin="5" Source="{Binding Icon}"/>
                                <Label x:Name="txt" Visibility="Visible" BorderThickness="0"
                                       Foreground="{StaticResource PrimaryColorContract}"
                                <Label x:Name="txt" BorderThickness="0"
                                       Foreground="{Binding Foreground,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListBoxItem}}"
                                       FontWeight="Bold" 
                                       FontSize="16"
                                       VerticalContentAlignment="Center" 
@@ -103,7 +108,7 @@
                 Visibility="{Binding MenuVisibility}"
                 SelectedItem="{Binding SelectedSubMenu}" AlternationCount="{Binding SubMenuItemsCount}"
                 SelectionChanged="SubMenu_SelectionChanged"
BorderThickness="0,0,0,1" ItemsSource="{Binding SubMenuItems}">
BorderThickness="0" ItemsSource="{Binding SubMenuItems}">
        </ListBox>
        <Border x:Name="page"  Grid.Row="2" BorderThickness="0" Margin="0" Padding="0">