<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:resources="clr-namespace:C1.WPF.FlexViewer.Resources"
    mc:Ignorable="d"
    >

    <resources:C1_FlexViewer x:Key="Strings"/>

    <sys:Double x:Key="FontSize">13</sys:Double>
    <sys:Double x:Key="ButtonHeight">26</sys:Double>
    <sys:Double x:Key="ButtonWidth">26</sys:Double>
    <sys:Double x:Key="TextBoxHeight">22</sys:Double>

    <CornerRadius x:Key="InnerBorderCornerRadius">2</CornerRadius>

    <Thickness x:Key="InnerBorderThickness">1</Thickness>

    <SolidColorBrush x:Key="NormalBackground" Color="#FFDCDCDC" />
    <SolidColorBrush x:Key="BorderBrush" Color="#FFB0B0B0" />
    <SolidColorBrush x:Key="MouseOverBackground" Color="#FFBDE6FD" />
    <SolidColorBrush x:Key="PressedBackground" Color="#FFA9DAF3" />

    <LinearGradientBrush x:Key="ToolbarBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#FFD1DCE8" Offset="0" />
        <GradientStop Color="#FFFAFBFC" Offset="0.7" />
    </LinearGradientBrush>

    <SolidColorBrush x:Key="IconBrush1" Color="#FF3080D0" />
    <SolidColorBrush x:Key="IconBrush2" Color="#FF303030" />
    <SolidColorBrush x:Key="IconBrush3" Color="#FFF03030" />

    <SolidColorBrush x:Key="ComboButtonForegroundBrush" Color="Black" />

    <Color x:Key="SelectedOutlineExpandButtonColor">White</Color>
    <Color x:Key="SelectedOutlineItemTextColor">White</Color>

    <Color x:Key="NormalOutlineExpandButtonColor">#FF0C5C81</Color>
    <Color x:Key="NormalOutlineItemTextColor">#FF0C5C81</Color>

    <SolidColorBrush x:Key="SelectedOutlineItemBackground" Color="#FF0C5C81" />
    <SolidColorBrush x:Key="MouseOverOutlineItemBackground" Color="#19000000" />
    <SolidColorBrush x:Key="OutlineTreeViewBackground" Color="#FFFEFEFE" />

    <SolidColorBrush x:Key="SplitterBackground" Color="#FFFEFEFE" />

    <SolidColorBrush x:Key="ToolFrameBackground" Color="#FFFEFEFE" />
    <SolidColorBrush x:Key="ToolFrameNormalForeground" Color="Black" />
    <SolidColorBrush x:Key="ToolFrameErrorForeground" Color="Red" />

    <Color x:Key="BaseDesignColor">#FFD1DCE8</Color>
    <Color x:Key="MouseOverDesignColor">#FFBFE1EA</Color>
    <Color x:Key="SelectedDesignColor">#FF8ED1E2</Color>
    <SolidColorBrush x:Key="BorderNormalDesignBrush" Color="#FFFAFBFC" />
    <SolidColorBrush x:Key="BorderMouseOverDesignBrush" Color="#FFFAFBFC" />
    <SolidColorBrush x:Key="BorderPressedDesignBrush" Color="#FFFAFBFC" />
    <SolidColorBrush x:Key="SeparatorDesignBrush" Color="{StaticResource BaseDesignColor}" />
    <SolidColorBrush x:Key="CheckedDesignBrush" Color="#FF8ED1E2" />
    <LinearGradientBrush x:Key="NormalDesignBrush" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#FFF2F2F2" Offset="0" />
        <GradientStop Color="#FFEBEBEB" Offset="0.5" />
        <GradientStop Color="#FFDCDCDC" Offset="0.5" />
        <GradientStop Color="#FFD0D0D0" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="MouseOverDesignBrush" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#FFE7F5FD" Offset="0" />
        <GradientStop Color="#FFDCF0FC" Offset="0.5" />
        <GradientStop Color="#FFBDE6FD" Offset="0.5" />
        <GradientStop Color="#FFA9D9F5" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="PressedDesignBrush" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#FFA9D9F5" Offset="0" />
        <GradientStop Color="#FFC1E4F5" Offset="0.5" />
        <GradientStop Color="#FFA9DAF3" Offset="0.5" />
        <GradientStop Color="#FF91CDEB" Offset="1" />
    </LinearGradientBrush>

    <Style x:Key="ToolbarButtonStyle" TargetType="ButtonBase">
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Height" Value="{StaticResource ButtonHeight}" />
        <Setter Property="Padding" Value="3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ButtonBase">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="MouseOverElement" 
                                            Storyboard.TargetProperty="(UIElement.Visibility)" 
                                            Duration="0"
                                            >
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="PressedElement" 
                                            Storyboard.TargetProperty="(UIElement.Visibility)" 
                                            Duration="0"
                                            >
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation 
                                            Duration="0" 
                                            To="0.5" 
                                            Storyboard.TargetProperty="(UIElement.Opacity)" 
                                            Storyboard.TargetName="BackgroundElement" 
                                            d:IsOptimized="True" 
                                            />
                                        <DoubleAnimation 
                                            Duration="0" 
                                            To="0.5" 
                                            Storyboard.TargetProperty="(UIElement.Opacity)" 
                                            Storyboard.TargetName="contentPresenter" 
                                            d:IsOptimized="True" 
                                            />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="CheckedElement" 
                                            Storyboard.TargetProperty="(UIElement.Visibility)" 
                                            Duration="0"
                                            >
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation 
                                            Duration="0" 
                                            To="1" 
                                            Storyboard.TargetProperty="Opacity" 
                                            Storyboard.TargetName="FocusVisualElement" 
                                            />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <c1:C1BrushBuilder
                            x:Name="BackgroundBrush"
                            Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"
                            DesignBrush="{StaticResource NormalDesignBrush}"
                            DesignColor="{StaticResource BaseDesignColor}"
                            />
                        <c1:C1BrushBuilder
                            x:Name="MouseOverBrush"
                            Input="{StaticResource MouseOverBackground}"
                            DesignBrush="{StaticResource MouseOverDesignBrush}"
                            DesignColor="{StaticResource MouseOverDesignColor}"
                            />
                        <c1:C1BrushBuilder
                            x:Name="PressedBrush"
                            Input="{StaticResource PressedBackground}"
                            DesignBrush="{StaticResource PressedDesignBrush}"
                            DesignColor="{StaticResource SelectedDesignColor}"
                            />
                        <c1:C1BrushBuilder
                            x:Name="CheckedBrush"
                            Input="{StaticResource PressedBackground}"
                            DesignBrush="{StaticResource CheckedDesignBrush}"
                            DesignColor="{StaticResource SelectedDesignColor}"
                            />
                        <c1:C1BrushBuilder
                            x:Name="InnerBorderBrush"
                            Input="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"
                            DesignBrush="{StaticResource BorderNormalDesignBrush}"
                            DesignColor="{StaticResource BaseDesignColor}"
                            />
                        <c1:C1BrushBuilder
                            x:Name="InnerBorderMouseOverBrush"
                            Input="{StaticResource MouseOverBackground}"
                            DesignBrush="{StaticResource BorderMouseOverDesignBrush}"
                            DesignColor="{StaticResource MouseOverDesignColor}"
                            />
                        <c1:C1BrushBuilder
                            x:Name="InnerBorderPressedBrush"
                            Input="{StaticResource PressedBackground}"
                            DesignBrush="{StaticResource BorderPressedDesignBrush}"
                            DesignColor="{StaticResource SelectedDesignColor}"
                            />
                        <Border
                            x:Name="BackgroundElement"
                            Background="{Binding Output, ElementName=BackgroundBrush}"
                            BorderBrush="{StaticResource BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{StaticResource InnerBorderCornerRadius}"
                            >
                            <Border
                                BorderBrush="{Binding Output, ElementName=InnerBorderBrush}"
                                BorderThickness="{StaticResource InnerBorderThickness}"
                                CornerRadius="{StaticResource InnerBorderCornerRadius}"
                                />
                        </Border>
                        <Border
                            x:Name="CheckedElement"
                            Background="{Binding Output, ElementName=CheckedBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{StaticResource InnerBorderCornerRadius}"
                            Visibility="Collapsed"
                            />
                        <Border
                            x:Name="MouseOverElement"
                            Background="{Binding Output, ElementName=MouseOverBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{StaticResource InnerBorderCornerRadius}"
                            Visibility="Collapsed"
                            >
                            <Border
                                BorderBrush="{Binding Output, ElementName=InnerBorderMouseOverBrush}"
                                BorderThickness="{StaticResource InnerBorderThickness}"
                                CornerRadius="{StaticResource InnerBorderCornerRadius}"
                                />
                        </Border>
                        <Border
                            x:Name="PressedElement"
                            Background="{Binding Output, ElementName=PressedBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{StaticResource InnerBorderCornerRadius}"
                            Visibility="Collapsed"
                            >
                            <Border
                                BorderBrush="{Binding Output, ElementName=InnerBorderPressedBrush}"
                                BorderThickness="{StaticResource InnerBorderThickness}"
                                CornerRadius="{StaticResource InnerBorderCornerRadius}"
                                />
                        </Border>

                        <ContentPresenter
                            x:Name="contentPresenter"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            Margin="{TemplateBinding Padding}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Content="{TemplateBinding Content}"
                            ContentTemplate="{TemplateBinding ContentTemplate}"
                            />
                        <Border
                            x:Name="FocusVisualElement"
                            BorderBrush="#FFA9DAF3"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="{StaticResource InnerBorderCornerRadius}"
                            IsHitTestVisible="false"
                            Opacity="0"
                            />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>