<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Brushes/DefaultColorTheme.xaml"/>
        <ResourceDictionary Source="ButtonFocusVisualStyle.xaml"></ResourceDictionary>
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="NormalToggleButton" TargetType="{x:Type ToggleButton}">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="ClickMode" Value="Press"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border x:Name="Border" 
                            BorderBrush="{StaticResource ButtonNormalBackgroundBrush}" 
                            BorderThickness="3" 
                            CornerRadius="0"
                            Background="{StaticResource ButtonNormalForegroundBrush}"
                            Opacity="1.0">
                        <Grid HorizontalAlignment="Right" Width="30">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="5"/>
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Path x:Name="Arrow"
                                  Grid.Column="1"
                                  Fill="{StaticResource ButtonNormalBackgroundBrush}"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Center"
                                  Data="M 0 0 L 4 4 L 8 0 Z"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="Border" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="White" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ActiveElementBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Opacity" Value="0.8" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NormalTextBox" TargetType="{x:Type TextBox}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="Foreground" Value="{StaticResource ButtonNormalBackgroundBrush}"></Setter>
        <Setter Property="SelectionBrush" Value="{StaticResource ButtonNormalBackgroundBrush}"></Setter>
        <Setter Property="SelectionOpacity" Value="0.2"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border Name="PART_ContentHost" 
                            Background="Transparent" 
                            Margin="0,0,0,0"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ComboBoxItem}" x:Key="ComboBoxItemStyle">
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Foreground" Value="{StaticResource ButtonNormalBackgroundBrush}"></Setter>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                    <Border Name="Border" Background="{StaticResource ButtonNormalForegroundBrush}">
                        <ContentPresenter Margin="10,5,0,5"></ContentPresenter>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="True">
                            <Setter TargetName="Border" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ActiveElementBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground">
                                <Setter.Value>
                                    <SolidColorBrush Color="White" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Foreground" Value="White"/>
                            <Setter TargetName="Border" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ButtonNormalBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Foreground">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ButtonNormalForegroundColor}" />
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="Border" Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ButtonNormalBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ComboBoxFiltered" TargetType="ComboBox">
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="Width" Value="220"/>
        <Setter Property="Foreground" Value="{StaticResource ButtonNormalBackgroundBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource ComboBoxItemStyle}"/>
        <Setter Property="Margin" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="PART_EditableTextBox" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">
                                            <EasingColorKeyFrame KeyTime="0" Value="GreenYellow" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="EditStates">
                                <VisualState x:Name="Editable">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_EditableTextBox">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ContentSite">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Uneditable" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ToggleButton Name="ToggleButton"
                                      Style="{StaticResource NormalToggleButton}"
                                      IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}">
                        </ToggleButton>
                        <ContentPresenter x:Name="ContentSite"
                            IsHitTestVisible="False"
                            Content="{TemplateBinding SelectionBoxItem}"
                            ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                            Margin="10,6,23,6"
                            VerticalAlignment="Stretch"
                            HorizontalAlignment="Left">
                        </ContentPresenter>
                        <TextBox Name="PART_EditableTextBox"
                                 Style="{StaticResource NormalTextBox}"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Center"
                                 Margin="10,0,0,0"
                                 Focusable="True"
                                 Background="Transparent"
                                 Visibility="Visible"
                                 IsReadOnly="{TemplateBinding IsReadOnly}" />
                        <Popup Name="Popup"
                               Placement="Bottom"
                               IsOpen="{TemplateBinding IsDropDownOpen}"
                               AllowsTransparency="True"
                               Focusable="False"
                               PopupAnimation="Fade">
                            <Grid Name="DropDown"                                  
                                  Width="{TemplateBinding ActualWidth}"
                                  MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                <Border x:Name="DropDownBorder"
                                        Background="{StaticResource ButtonNormalForegroundBrush}"
                                        BorderThickness="3"
                                        BorderBrush="{StaticResource ButtonNormalBorderBrush}"
                                        CornerRadius="0"
                                        Margin="0,-3,0,0">
                                    <StackPanel Margin="10,5,0,5">
                                        <TextBlock Text="{Binding VerifyLanguageString.WriteInNoHits, FallbackValue='No hits'}"/>
                                    </StackPanel>
                                </Border>
                                <ScrollViewer SnapsToDevicePixels="True">
                                    <ItemsPresenter MinHeight="100" Width="{TemplateBinding ActualWidth}" Margin="6"></ItemsPresenter>
                                </ScrollViewer>
                            </Grid>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ActiveElementBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="DropDownBorder" Property="Opacity" Value="0.5" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    

</ResourceDictionary>
                    
