<ResourceDictionary 
mc:Ignorable="d" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:c1="using:C1.Xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/Common.xaml"/>
        <ResourceDictionary Source="ms-appx:///C1.UWP/themes/C1Button.xaml"/>
	</ResourceDictionary.MergedDictionaries>

    <Style TargetType="TextBlock" x:Key="TextIconStyle">
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Foreground" Value="{ThemeResource SystemControlForegroundBaseMediumHighBrush}" />
        <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Margin" Value="5,-1"/>
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="AutomationProperties.AccessibilityView" Value="Raw"/>
    </Style>
    
    <!--******************** ContentControlStyle *********************-->

    <!--ContentControl -->
    <Style x:Key="ContentControlStyle" TargetType="ContentControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--******************* C1DropDown *****************-->

    <!-- Brush @ C1DropDown Arrow ToggleButton Thickness -->
    <Thickness x:Key="DropDownArrowToggleThickness">0 0 0 0</Thickness>

    <Style x:Key="C1.Silverlight.DropDownButton" TargetType="c1:C1DropDownButton">
        <Setter Property="Foreground" Value="{ThemeResource ComboBoxForegroundThemeBrush}"/>
        <Setter Property="Background" Value="{ThemeResource ComboBoxBackgroundThemeBrush}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource ComboBoxBorderThemeBrush}"/>
        <Setter Property="BorderThickness" Value="{ThemeResource ComboBoxBorderThemeThickness}"/>
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}"/>
        <Setter Property="HeaderBackground" Value="{ThemeResource ComboBoxBackgroundThemeBrush}" />
        <Setter Property="HeaderForeground" Value="{ThemeResource ComboBoxForegroundThemeBrush}" />
        <Setter Property="CornerRadius" Value="{StaticResource GeneralCornerRadius}" />
        <Setter Property="VerticalHeaderAlignment" Value="Stretch" />
        <Setter Property="HorizontalHeaderAlignment" Value="Stretch" />
        <Setter Property="HeaderPadding" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1DropDownButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DropDownOpenStates">
                                <VisualState x:Name="Closed" />
                                <VisualState x:Name="Opened" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled" />
                                <VisualState x:Name="MouseOver" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidUnfocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ValidationDecorator" Storyboard.TargetProperty="ValidationState">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <c1:ValidationState>InvalidFocused</c1:ValidationState>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ToggleButton x:Name="ArrowToggle" Style="{StaticResource ClearStyleToggleButtonStyle}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" c1:ClearStyleExtensions.CornerRadius="{TemplateBinding CornerRadius}" Background="{TemplateBinding HeaderBackground}" Foreground="{TemplateBinding HeaderForeground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Padding="0" IsTabStop="True" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" FontStyle="{TemplateBinding HeaderFontStyle}" FontWeight="{TemplateBinding HeaderFontWeight}" FontSize="{TemplateBinding HeaderFontSize}">
                            <Grid Margin="{TemplateBinding BorderThickness}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <ContentPresenter x:Name="HeaderPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Margin="{TemplateBinding HeaderPadding}" VerticalAlignment="{TemplateBinding VerticalHeaderAlignment}" HorizontalAlignment="{TemplateBinding HorizontalHeaderAlignment}" />
                                <TextBlock x:Name="ArrowPolygon" Text="&#xE0E5;" Style="{StaticResource TextIconStyle}" Grid.Column="1"/>
                            </Grid>
                        </ToggleButton>
                        <c1:C1ValidationDecorator x:Name="ValidationDecorator" Target="{Binding RelativeSource={RelativeSource TemplatedParent}}" Style="{TemplateBinding ValidationDecoratorStyle}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="c1:C1DropDownButton" BasedOn="{StaticResource C1.Silverlight.DropDownButton}" />

    <Style TargetType="c1:C1DropDown" BasedOn="{StaticResource C1.Silverlight.DropDownButton}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1:C1DropDown">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DropDownOpenStates">
                                <VisualState x:Name="Closed" />
                                <VisualState x:Name="Opened" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentControl">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxDisabledForegroundThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="FocusedVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="BackgroundElement" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" />
                        <Border x:Name="MouseOverElement" Background="{TemplateBinding MouseOverBrush}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{ThemeResource ComboBoxPointerOverBorderThemeBrush}" CornerRadius="{TemplateBinding CornerRadius}" Visibility="Collapsed" />
                        <Border x:Name="FocusedVisualElement" BorderBrush="{ThemeResource ComboBoxFocusedBorderThemeBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding FocusBrush}" CornerRadius="{TemplateBinding CornerRadius}" Visibility="{TemplateBinding FocusCuesVisibility}" Opacity="0" />
                        <Border x:Name="DisabledVisualElement" Background="{ThemeResource ComboBoxDisabledBackgroundThemeBrush}" BorderBrush="{ThemeResource ComboBoxDisabledBorderThemeBrush}" CornerRadius="{TemplateBinding CornerRadius}" IsHitTestVisible="False" Opacity="0" Visibility="{TemplateBinding DisabledCuesVisibility}" />
                        <Grid Margin="{TemplateBinding BorderThickness}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <ToggleButton Grid.Column="2" Style="{StaticResource ClearStyleButtonStyle}" c1:ClearStyleExtensions.MouseOverBrush="{TemplateBinding MouseOverBrush}" c1:ClearStyleExtensions.PressedBrush="{TemplateBinding PressedBrush}" c1:ClearStyleExtensions.FocusBrush="{TemplateBinding FocusBrush}" c1:ClearStyleExtensions.CornerRadius="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource sideRadiusConverter}, ConverterParameter='topright bottomright'}" Background="{TemplateBinding Background}" Foreground="{TemplateBinding HeaderForeground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource DropDownArrowToggleThickness}" IsEnabled="{TemplateBinding IsEnabled}" IsTabStop="{TemplateBinding IsTabStop}" Padding="0" x:Name="ArrowToggle" VerticalAlignment="Stretch">
                                <TextBlock x:Name="ArrowPolygon" Text="&#xE0E5;" Style="{StaticResource TextIconStyle}" />
                            </ToggleButton>
                            <ContentControl x:Name="ContentControl" FontFamily="{TemplateBinding HeaderFontFamily}" FontSize="{TemplateBinding HeaderFontSize}" FontStretch="{TemplateBinding HeaderFontStretch}" FontStyle="{TemplateBinding HeaderFontStyle}" FontWeight="{TemplateBinding HeaderFontWeight}" Foreground="{TemplateBinding HeaderForeground}" IsTabStop="False" Padding="{TemplateBinding HeaderPadding}" HorizontalAlignment="{TemplateBinding HorizontalHeaderAlignment}" VerticalAlignment="{TemplateBinding VerticalHeaderAlignment}">
                                <ContentControl.Template>
                                    <ControlTemplate TargetType="ContentControl">
                                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" />
                                    </ControlTemplate>
                                </ContentControl.Template>
                                <ContentPresenter x:Name="HeaderPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" />
                            </ContentControl>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>