<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:utils="clr-namespace:SpineViewer.Utils"
                    xmlns:hc="https://handyorg.github.io/handycontrol">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <utils:StringFormatMultiValueConverter x:Key="StrFmtCvter"/>
    <utils:BackgroundToForegroundConverter x:Key="Bg2FgCvter"/>

    <Style x:Key="MyGridSplitterBaseStyle" TargetType="{x:Type GridSplitter}">
        <Setter Property="Background" Value="{DynamicResource SecondaryBorderBrush}"/>
        <Setter Property="ShowsPreview" Value="False"/>
        <Style.Triggers>
            <Trigger Property="ResizeDirection" Value="Columns">
                <Setter Property="Width" Value="3"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Stretch"/>
            </Trigger>
            <Trigger Property="ResizeDirection" Value="Rows">
                <Setter Property="Height" Value="3"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="HorizontalAlignment" Value="Stretch"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MyToggleButtonBaseStyle" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource ToggleButtonSwitch}">
        <Setter Property="hc:VisualElement.HighlightBrush" Value="{DynamicResource DarkSuccessBrush}"/>
    </Style>

    <Style x:Key="MyListBoxBaseStyle" TargetType="{x:Type ListBox}" BasedOn="{StaticResource ListBoxBaseStyle}">
        <Setter Property="SelectionMode" Value="Extended"/>
        <!--<Setter Property="VirtualizingPanel.IsVirtualizing" Value="False"/>-->
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Visible"/>
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource ListBoxItemBaseStyle}">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="Padding" Value="0"/>
                    <Setter Property="Margin" Value="0"/>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="MyListViewBaseStyle" TargetType="{x:Type ListView}" BasedOn="{StaticResource ListViewBaseStyle}">
        <Setter Property="SelectionMode" Value="Extended"/>
        <!--<Setter Property="VirtualizingPanel.IsVirtualizing" Value="False"/>-->
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemBaseStyle.Small}"/>
    </Style>

    <Style x:Key="MyGroupBoxBaseStyle" TargetType="{x:Type GroupBox}" BasedOn="{StaticResource GroupBoxTab}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="hc:TitleElement.Background" Value="Transparent"/>
    </Style>

    <Style x:Key="MyLogRichTextBoxStyle" TargetType="{x:Type RichTextBox}" BasedOn="{StaticResource RichTextBoxBaseStyle}">
        <Setter Property="IsReadOnly" Value="True"/>
        <Setter Property="FontFamily" Value="Consolas"/>
        <Setter Property="Block.LineHeight" Value="3"/>
        <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
    </Style>

    <Style x:Key="MyVerticalScrollViewerBaseStyle" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource ScrollViewerNativeBaseStyle}">
        <Setter Property="Padding" Value="0"/>
        <Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
        <Style.Triggers>
            <Trigger Property="ComputedVerticalScrollBarVisibility" Value="Visible">
                <Setter Property="Padding" Value="0 0 5 0"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MyTabItemHeaderPathStyle" TargetType="Path">
        <Setter Property="Stretch" Value="Uniform"/>
        <Setter Property="Stroke" Value="{DynamicResource PrimaryTextBrush}"/>
        <Setter Property="StrokeThickness" Value="20"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=TabItem}, Path=IsSelected}" Value="True">
                <Setter Property="Stroke" Value="{DynamicResource PrimaryBrush}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MyTabItemHeaderContainerStyle" TargetType="Border">
        <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
        <Setter Property="Margin" Value="-10 -5 -8 -5"/>
        <Setter Property="Padding" Value="10 5"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Cursor" Value="Hand"/>
                <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type GridSplitter}" BasedOn="{StaticResource MyGridSplitterBaseStyle}"/>
    <Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MyToggleButtonBaseStyle}"/>
    <Style TargetType="{x:Type ListBox}" BasedOn="{StaticResource MyListBoxBaseStyle}"/>
    <Style TargetType="{x:Type ListView}" BasedOn="{StaticResource MyListViewBaseStyle}"/>
    <Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource MyGroupBoxBaseStyle}"/>

</ResourceDictionary>
