chr
2024-03-07 303e6180d4f3d88e0feafc9515cae3be8117d2e7
Controls/MenuTabControl.xaml
@@ -14,9 +14,54 @@
                <ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <Style x:Key="tabItemStyle" TargetType="{x:Type ctl:IconTabItem}">
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Background" Value="{StaticResource ButtonColor}"/>
                <Setter Property="Foreground" Value="{StaticResource ButtonFont}"/>
                <Setter Property="HeaderFontSize" Value="15"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate x:Name="ct" TargetType="{x:Type ctl:IconTabItem}">
                            <Border x:Name="templateRoot" BorderThickness="1,1,1,1" Padding="10"
                    BorderBrush="Gray"
                    Background="{TemplateBinding Background}">
                                <StackPanel HorizontalAlignment="Center">
                                    <Image Width="30" Height="30" Source="{TemplateBinding Icon}"/>
                                    <Label x:Name="txt" Visibility="Visible" BorderThickness="0"
                           VerticalContentAlignment="Center"
                           HorizontalAlignment="Left"
                           FontSize="{TemplateBinding HeaderFontSize}"
                           Content="{TemplateBinding Header}" ToolTip="{TemplateBinding Header}"
                           Foreground="{TemplateBinding Foreground}" />
                                </StackPanel>
                            </Border>
                            <ControlTemplate.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="BorderThickness" TargetName="templateRoot" Value="1,1,1,1"/>
                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ButtonFontSelected}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Foreground" TargetName="txt" Value="{StaticResource ButtonFontSelected}"/>
                                    <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ButtonSelected}"/>
                                </MultiDataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ControlStyle" TargetType="{x:Type TabControl}">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="BorderBrush" Value="Transparent"/>
                <Setter Property="ItemContainerStyle" Value="{StaticResource tabItemStyle}"/>
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                <Setter Property="Template">
                    <Setter.Value>
@@ -92,54 +137,12 @@
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="tabItemStyle" TargetType="{x:Type ctl:IconTabItem}">
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Background" Value="{StaticResource ButtonColor}"/>
                <Setter Property="Foreground" Value="{StaticResource ButtonFont}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ctl:IconTabItem}">
                            <Border x:Name="templateRoot" BorderThickness="1,1,1,1" Padding="10"
                                BorderBrush="Gray"
                                Background="{TemplateBinding Background}">
                                <Label x:Name="txt" Visibility="Visible" BorderThickness="0"
                                   VerticalContentAlignment="Center"
                                   HorizontalAlignment="Left"
                                   FontSize="{TemplateBinding HeaderFontSize}"
                                   Content="{TemplateBinding Header}" ToolTip="{TemplateBinding Header}"
                                   Foreground="{TemplateBinding Foreground}" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="BorderThickness" TargetName="templateRoot" Value="1,1,1,1"/>
                                    <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ButtonFontSelected}"/>
                                </MultiDataTrigger>
                                <MultiDataTrigger>
                                    <MultiDataTrigger.Conditions>
                                        <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
                                    </MultiDataTrigger.Conditions>
                                    <Setter Property="Foreground" TargetName="txt" Value="{StaticResource ButtonFontSelected}"/>
                                    <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ButtonSelected}"/>
                                </MultiDataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <TabControl x:Name="tabLevel_1" 
                    Style="{StaticResource ControlStyle}"
                    ItemContainerStyle="{StaticResource tabItemStyle}" ItemsSource="{Binding Items}"
                    Style="{StaticResource ControlStyle}" ItemsSource="{Binding Items}"
                    SelectedItem="{Binding SelectedItem,Mode=TwoWay}"
                    SelectionChanged="tabLevel_1_SelectionChanged">