<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="Margin" Value="3" />
        <Setter Property="Foreground" Value="{StaticResource ButtonNormalBackgroundBrush}"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border x:Name="Border" 
                            BorderBrush="{StaticResource ButtonNormalForegroundBrush}" 
                            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="{StaticResource ButtonKeyboardFocusBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ButtonKeyboardFocusForegroundColor}" />
                                </Setter.Value>
                            </Setter>
                        </Trigger></ControlTemplate.Triggers>
                </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="{TemplateBinding Background}">
                        <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 ButtonKeyboardFocusForegroundColor}" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource ButtonKeyboardFocusBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ComboBoxNormal" 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="180"/>
        <Setter Property="Height" Value="40"/>
        <Setter Property="Foreground" Value="{StaticResource ButtonNormalBackgroundBrush}"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource ComboBoxItemStyle}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <ToggleButton Name="ToggleButton"
                                      Style="{StaticResource NormalToggleButton}"
                                      IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}">
                        </ToggleButton>
                        <ContentControl Name="ContentSite"
                                        IsHitTestVisible="False"
                                        Content="{TemplateBinding SelectionBoxItem}"
                                        ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                        ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                        Margin="10,3,23,3"
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Focusable="False"/>
                        <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"/>
                                <ScrollViewer SnapsToDevicePixels="True">
                                    <ItemsPresenter 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 ButtonMouseOverBackgroundColor}" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
                    
