<Application x:Class="PatchClient.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:PatchClient"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <!-- Colors -->
        <Color x:Key="AKI_DarkGray">#121212</Color>
        <Color x:Key="AKI_Yellow">#FFC107</Color>
        <Color x:Key="AKI_White">#FFFFFF</Color>
        <Color x:Key="AKI_Gray">#282828</Color>
        <Color x:Key="AKI_DarkGrayBlue">#323947</Color>

        <!-- Brushes -->
        <SolidColorBrush x:Key="AKI_Foreground_Light" Color="{StaticResource AKI_White}"/>
        <SolidColorBrush x:Key="AKI_Background_Light" Color="{StaticResource AKI_Gray}"/>
        <SolidColorBrush x:Key="AKI_Background_Dark" Color="{StaticResource AKI_DarkGray}"/>
        <SolidColorBrush x:Key="AKI_Background_Yellow" Color="{StaticResource AKI_Yellow}"/>
        <SolidColorBrush x:Key="AKI_Background_DarkGrayBlue" Color="{StaticResource AKI_DarkGrayBlue}"/>

        <!-- Remove Hightlight effect from buttons -->
        <Style x:Key="NoChromeButton" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid x:Name="NoChromeGrid" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Trigger.EnterActions>
                                    <BeginStoryboard x:Name="disable_enter">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:0.100" BeginTime="0:0:0.100"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.EnterActions>
                                <Trigger.ExitActions>
                                    <RemoveStoryboard BeginStoryboardName="disable_enter"/>
                                    <BeginStoryboard>
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.100"/>
                                        </Storyboard>
                                    </BeginStoryboard>
                                </Trigger.ExitActions>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- App Button Base Style -->
        <Style x:Key="AppButtonStyleBase" TargetType="{x:Type Button}" BasedOn="{StaticResource NoChromeButton}">
            <Setter Property="Foreground" Value="Gray"/>
            <Setter Property="Background" Value="{StaticResource AKI_Background_Dark}"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="MinWidth" Value="40"/>
            <Setter Property="MinHeight" Value="25"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>

        <!-- Close App Button Style -->
        <Style x:Key="AppCloseButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource AppButtonStyleBase}">
            <Style.Triggers>
                <EventTrigger RoutedEvent="PreviewMouseDown">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="{StaticResource AKI_DarkGrayBlue}" Duration="0:0:0.200"/>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Foreground).(SolidColorBrush.Color)" To="White" Duration="0:0:0.200"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="MouseEnter">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="IndianRed" Duration="0:0:0.200"/>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Foreground).(SolidColorBrush.Color)" To="White" Duration="0:0:0.200"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="MouseLeave">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="{StaticResource AKI_DarkGray}" Duration="0:0:0.200"/>
                            <ColorAnimation Storyboard.TargetProperty="(Button.Foreground).(SolidColorBrush.Color)" To="Gray" Duration="0:0:0.200"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Style.Triggers>
        </Style>

        <!-- TextBlock Style -->
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/>
            <Setter Property="Opacity" Value="0"/>
            <Style.Triggers>
                <EventTrigger RoutedEvent="Loaded">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.250" BeginTime="0:0:0.150"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Style.Triggers>
        </Style>

        <!-- Label Style-->
        <Style TargetType="{x:Type Label}">
            <Setter Property="Foreground" Value="{StaticResource AKI_Foreground_Light}"/>
            <Setter Property="Opacity" Value="0"/>
            <Style.Triggers>
                <EventTrigger RoutedEvent="Loaded">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.250" BeginTime="0:0:0.150"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Style.Triggers>
        </Style>
        
        <!-- Progressbar Style -->
        <Style TargetType="{x:Type ProgressBar}">
            <Setter Property="Foreground" Value="{StaticResource AKI_Background_Yellow}"/>
            <Setter Property="Background" Value="{StaticResource AKI_Background_DarkGrayBlue}"/>
            <Setter Property="BorderBrush" Value="{StaticResource AKI_Background_DarkGrayBlue}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Opacity" Value="0"/>
            <Style.Triggers>
                <EventTrigger RoutedEvent="Loaded">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.250" BeginTime="0:0:0.150"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Style.Triggers>
        </Style>
    </Application.Resources>
</Application>

<!--Foreground="{StaticResource AKI_Background_Yellow}"
                                 Background="{StaticResource AKI_Background_DarkGrayBlue}"
                                 BorderBrush="{StaticResource AKI_Background_DarkGrayBlue}"
                                 BorderThickness="0"-->