<Application
    x:Class="ModernWpf.SampleApp.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ui="http://schemas.modernwpf.com/2019"
    xmlns:local="clr-namespace:ModernWpf.SampleApp"
    xmlns:common="clr-namespace:ModernWpf.SampleApp.Common"
    xmlns:sc="clr-namespace:SamplesCommon;assembly=SamplesCommon"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:presets="clr-namespace:ModernWpf.SampleApp.Presets"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ui:ThemeResources CanBeAccessedAcrossThreads="{x:Static local:App.IsMultiThreaded}">
                    <ui:ThemeResources.ThemeDictionaries>
                        <ResourceDictionary x:Key="Light" ui:ThemeDictionary.Key="Light">
                            <ResourceDictionary.MergedDictionaries>
                                <presets:ColorPresetResources TargetTheme="Light" />
                                <presets:ShapePresetResources />
                            </ResourceDictionary.MergedDictionaries>
                            <SolidColorBrush x:Key="AppBackgroundBrush" Color="#FFF1F1F1" />
                            <SolidColorBrush x:Key="AppContentBackgroundBrush" Color="{StaticResource SystemAltHighColor}" />
                            <SolidColorBrush x:Key="CustomThemeBrush" Color="Red" />
                        </ResourceDictionary>

                        <ResourceDictionary x:Key="Dark" ui:ThemeDictionary.Key="Dark">
                            <ResourceDictionary.MergedDictionaries>
                                <presets:ColorPresetResources TargetTheme="Dark" />
                                <presets:ShapePresetResources />
                            </ResourceDictionary.MergedDictionaries>
                            <SolidColorBrush x:Key="AppBackgroundBrush" Color="#FF232323" />
                            <SolidColorBrush x:Key="AppContentBackgroundBrush" Color="#FF282828" />
                            <SolidColorBrush x:Key="CustomThemeBrush" Color="Yellow" />
                        </ResourceDictionary>

                        <ResourceDictionary x:Key="HighContrast" ui:ThemeDictionary.Key="HighContrast">
                            <ResourceDictionary.MergedDictionaries>
                                <ResourceDictionary Source="HighContrast.xaml" />
                            </ResourceDictionary.MergedDictionaries>
                        </ResourceDictionary>
                    </ui:ThemeResources.ThemeDictionaries>
                </ui:ThemeResources>
                
                <ui:XamlControlsResources />

                <!-- Font Overrides -->
                <!--<sc:FontOverrides FontFamily="Comic Sans MS" />-->
                <!--<ResourceDictionary>
                    <FontFamily x:Key="DefaultFontFamily">Comic Sans MS</FontFamily>
                    <StaticResource x:Key="{x:Static SystemFonts.MessageFontFamilyKey}" ResourceKey="DefaultFontFamily" />
                    <StaticResource x:Key="ContentControlThemeFontFamily" ResourceKey="DefaultFontFamily" />
                    <StaticResource x:Key="PivotHeaderItemFontFamily" ResourceKey="DefaultFontFamily" />
                    <StaticResource x:Key="PivotTitleFontFamily" ResourceKey="DefaultFontFamily" />
                </ResourceDictionary>-->
                
            </ResourceDictionary.MergedDictionaries>

            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
            <sc:EnumValuesConverter x:Key="EnumValuesConverter" />
            <sc:ColorToBrushConverter x:Key="ColorToBrushConverter" />
            <common:BrushToColorConverter x:Key="BrushToColorConverter" />
            <common:InverseAppThemeConverter x:Key="InverseAppThemeConverter" />
            <common:BooleanToValueConverter x:Key="booleanToValueConverter" />
            <common:CornerRadiusToDoubleConverter x:Key="CornerRadiusToDoubleConverter" />

            <Style TargetType="ScrollViewer" BasedOn="{StaticResource DefaultScrollViewerStyle}">
                <Setter Property="sc:AutoPanningMode.IsEnabled" Value="True" />
            </Style>

            <Style x:Key="OptionsPanelStyle" TargetType="ui:SimpleStackPanel">
                <Setter Property="Spacing" Value="12" />
                <Style.Resources>
                    <Style TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
                        <Setter Property="MinWidth" Value="200" />
                    </Style>
                    <Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
                        <Setter Property="MinWidth" Value="200" />
                    </Style>
                    <Style TargetType="DatePicker" BasedOn="{StaticResource {x:Type DatePicker}}">
                        <Setter Property="MinWidth" Value="200" />
                    </Style>
                </Style.Resources>
            </Style>

            <Style x:Key="OutputTextBlockStyle" BasedOn="{StaticResource BodyTextBlockStyle}" TargetType="TextBlock">
                <Setter Property="Margin" Value="8,8,0,0" />
            </Style>

            <Thickness x:Key="ControlPageContentMargin">24,0,24,20</Thickness>

            <Style x:Key="ControlPageContentPanelStyle" TargetType="ui:SimpleStackPanel">
                <Setter Property="Margin" Value="{StaticResource ControlPageContentMargin}" />
                <Setter Property="Spacing" Value="16" />
            </Style>

            <Style x:Key="ControlExampleFullStyle" TargetType="sc:ControlExample">
                <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                <Setter Property="VerticalContentAlignment" Value="Stretch" />
                <Setter Property="MaxContentWidth" Value="{x:Static sys:Double.PositiveInfinity}" />
            </Style>

            <Style x:Key="RichTextBlockStyle" TargetType="RichTextBox" BasedOn="{StaticResource DefaultRichTextBoxStyle}">
                <Setter Property="Padding" Value="0" />
                <Setter Property="IsReadOnly" Value="True" />
                <Setter Property="IsTabStop" Value="False" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="RichTextBox">
                            <ScrollViewer x:Name="PART_ContentHost" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Resources>
                    <Style TargetType="Paragraph">
                        <Setter Property="Margin" Value="0" />
                    </Style>
                </Style.Resources>
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</Application>
