﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:common="using:FeedbackApp.Common">

    <!-- Deal with high contrast -->
    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary x:Key="Default">
            <SolidColorBrush x:Key="GrayBG" Color="#f6f6f6"/>
            <SolidColorBrush x:Key="BlackTextColor" Color="Black"/>
            <SolidColorBrush x:Key="GrayTextColor" Color="Gray"/>
            <SolidColorBrush x:Key="BlueTextColor" Color="#0078d7"/>
            <SolidColorBrush x:Key="BlueBorder" Color="#0078d7"/>
            <SolidColorBrush x:Key="GreenTextColor" Color="#70AC2E"/>
            <SolidColorBrush x:Key="LinkColor" Color="#0078d7"/>
            <SolidColorBrush x:Key="YellowTextColor" Color="#E88B10"/>
            <SolidColorBrush x:Key="RedTextColor" Color="#FF0000"/>
            <SolidColorBrush x:Key="ButtonBorder" Color="#33000000"/>
            <SolidColorBrush x:Key="ButtonBackground" Color="#0078d7"/>
            <SolidColorBrush x:Key="ButtonForeground" Color="White"/>
            <SolidColorBrush x:Key="ButtonDisabledBorder" Color="#1A000000"/>
            <SolidColorBrush x:Key="ButtonDisabledBackground" Color="#8CB8DB"/>
            <SolidColorBrush x:Key="ButtonDisabledForeground" Color="White"/>
            <SolidColorBrush x:Key="ButtonPointerOverBorder" Color="#33000000"/>
            <SolidColorBrush x:Key="ButtonPointerOverBackground" Color="#3F90D1"/>
            <SolidColorBrush x:Key="ButtonPointerOverForeground" Color="White"/>
            <SolidColorBrush x:Key="ButtonPressedBorder" Color="#33000000"/>
            <SolidColorBrush x:Key="ButtonPressedBackground" Color="#0064B3"/>
            <SolidColorBrush x:Key="ButtonPressedForeground" Color="White"/>
        </ResourceDictionary>
        <ResourceDictionary x:Key="HighContrast">
            <SolidColorBrush x:Key="GrayBG" Color="{ThemeResource SystemColorWindowColor}"/>
            <SolidColorBrush x:Key="BlackTextColor" Color="{ThemeResource SystemColorWindowTextColor}"/>
            <SolidColorBrush x:Key="GrayTextColor" Color="{ThemeResource SystemColorWindowTextColor}"/>
            <SolidColorBrush x:Key="BlueTextColor" Color="{ThemeResource SystemColorWindowTextColor}"/>
            <SolidColorBrush x:Key="BlueBorder" Color="{ThemeResource SystemColorWindowTextColor}"/>
            <SolidColorBrush x:Key="GreenTextColor" Color="{ThemeResource SystemColorWindowTextColor}"/>
            <SolidColorBrush x:Key="YellowTextColor" Color="{ThemeResource SystemColorWindowTextColor}"/>
            <SolidColorBrush x:Key="LinkColor" Color="{ThemeResource SystemColorHotLightColor}"/>
            <SolidColorBrush x:Key="RedTextColor" Color="{ThemeResource SystemColorWindowTextColor}"/>
            <SolidColorBrush x:Key="ButtonBorder" Color="{ThemeResource SystemColorButtonTextColor}"/>
            <SolidColorBrush x:Key="ButtonBackground" Color="{ThemeResource SystemColorButtonFaceColor}"/>
            <SolidColorBrush x:Key="ButtonForeground" Color="{ThemeResource SystemColorButtonTextColor}"/>
            <SolidColorBrush x:Key="ButtonDisabledBorder" Color="{ThemeResource SystemColorGrayTextColor}"/>
            <SolidColorBrush x:Key="ButtonDisabledBackground" Color="{ThemeResource SystemColorButtonFaceColor}"/>
            <SolidColorBrush x:Key="ButtonDisabledForeground" Color="{ThemeResource SystemColorGrayTextColor}"/>
            <SolidColorBrush x:Key="ButtonPointerOverBorder" Color="{ThemeResource SystemColorHighlightColor}"/>
            <SolidColorBrush x:Key="ButtonPointerOverBackground" Color="{ThemeResource SystemColorButtonFaceColor}"/>
            <SolidColorBrush x:Key="ButtonPointerOverForeground" Color="{ThemeResource SystemColorHighlightColor}"/>
            <SolidColorBrush x:Key="ButtonPressedBorder" Color="{ThemeResource SystemColorHighlightColor}"/>
            <SolidColorBrush x:Key="ButtonPressedBackground" Color="{ThemeResource SystemColorButtonFaceColor}"/>
            <SolidColorBrush x:Key="ButtonPressedForeground" Color="{ThemeResource SystemColorHighlightColor}"/>
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <Style x:Key="QuestionText" TargetType="TextBlock">
        <Setter Property="Margin" Value="0,0,0,26"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontWeight" Value="SemiLight"/>
        <Setter Property="FontSize" Value="24"/>
    </Style>

    <Style x:Key="FollowUpQuestion" TargetType="TextBlock">
        <Setter Property="Margin" Value="0,26,0,10"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="AutomationProperties.LiveSetting" Value="Polite"/>
        <Setter Property="FontFamily" Value="Segoe UI"/>
        <Setter Property="FontWeight" Value="SemiLight"/>
        <Setter Property="FontSize" Value="24"/>
    </Style>

    <Style x:Key="FollowUpQuestionTextBox" TargetType="TextBox">
        <Setter Property="Height" Value="100"/>
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="TextWrapping" Value="Wrap"/>
        <Setter Property="ScrollViewer.VerticalScrollMode" Value="Enabled"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="AcceptsReturn" Value="True"/>
        <Setter Property="AutomationProperties.LiveSetting" Value="Polite" />
    </Style>

    <Style x:Key="RadioButton" TargetType="RadioButton">
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="Padding" Value="6,7,0,0"/>
        <Setter Property="Margin" Value="0,0,0,10"/>
        <Setter Property="Foreground" Value="{ThemeResource BlackTextColor}"/>
    </Style>

    <!-- Default style for Windows.UI.Xaml.Controls.Button -->
    <Style x:Key="SIUFButton" TargetType="Button">
        <Setter Property="Background" Value="{ThemeResource ButtonBackground}" />
        <Setter Property="Foreground" Value="{ThemeResource ButtonForeground}"/>
        <Setter Property="BorderBrush" Value="{ThemeResource ButtonBorder}" />
        <Setter Property="BorderThickness" Value="{ThemeResource ButtonBorderThemeThickness}" />
        <Setter Property="Padding" Value="12,4,12,4" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter Property="FontWeight" Value="SemiBold" />
        <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                                                       Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverBackground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                   Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverBorder}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverForeground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                   Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPressedBackground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                   Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPressedBorder}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                   Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPressedForeground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                   Storyboard.TargetProperty="Background">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledBackground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Border"
                                   Storyboard.TargetProperty="BorderBrush">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledBorder}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                   Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonDisabledForeground}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
                                                     Storyboard.TargetProperty="Opacity"
                                                     To="1"
                                                     Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
                                                     Storyboard.TargetProperty="Opacity"
                                                     To="1"
                                                     Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="PointerFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Margin="3">
                            <ContentPresenter x:Name="ContentPresenter"
                                          Content="{TemplateBinding Content}"
                                          ContentTransitions="{TemplateBinding ContentTransitions}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                          AutomationProperties.AccessibilityView="Raw"/>
                        </Border>
                        <Rectangle x:Name="FocusVisualWhite"
                               IsHitTestVisible="False"
                               Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}"
                               StrokeEndLineCap="Square"
                               StrokeDashArray="1,1"
                               Opacity="0"
                               StrokeDashOffset="1.5" />
                        <Rectangle x:Name="FocusVisualBlack"
                               IsHitTestVisible="False"
                               Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}"
                               StrokeEndLineCap="Square"
                               StrokeDashArray="1,1"
                               Opacity="0"
                               StrokeDashOffset="0.5" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>


