<Application
    x:Class="v2rayN.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:conv="clr-namespace:v2rayN.Converters"
    xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
    ShutdownMode="OnExplicitShutdown"
    StartupUri="Views/MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary xmlns:system="clr-namespace:System;assembly=mscorlib">
            <ResourceDictionary.MergedDictionaries>
                <materialDesign:BundledTheme
                    BaseTheme="Light"
                    PrimaryColor="Blue"
                    SecondaryColor="Lime" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign2.Defaults.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <system:Double x:Key="MenuItemHeight">26</system:Double>
            <system:Double x:Key="StdFontSize">12</system:Double>
            <system:Double x:Key="StdFontSize1">13</system:Double>
            <system:Double x:Key="StdFontSize-1">11</system:Double>

            <conv:InverseBooleanConverter x:Key="InverseBooleanConverter" />
            <Thickness
                x:Key="Margin4"
                Bottom="4"
                Left="4"
                Right="4"
                Top="4" />
            <Thickness
                x:Key="Margin8"
                Bottom="8"
                Left="8"
                Right="8"
                Top="8" />
            <Thickness
                x:Key="OutlinedTextBoxDefaultPadding"
                Bottom="8"
                Left="8"
                Right="8"
                Top="8" />
            <Thickness
                x:Key="MarginLeftRight4"
                Bottom="0"
                Left="4"
                Right="4"
                Top="0" />
            <Thickness
                x:Key="MarginLeftRight8"
                Bottom="0"
                Left="8"
                Right="8"
                Top="0" />
            <Thickness
                x:Key="MarginLeft8"
                Bottom="0"
                Left="8"
                Right="0"
                Top="0" />
            <Thickness
                x:Key="MarginRight8"
                Bottom="0"
                Left="0"
                Right="8"
                Top="0" />
            <Style
                x:Key="ModuleTitle"
                BasedOn="{StaticResource MaterialDesignTextBlock}"
                TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize1}" />
            </Style>
            <Style
                x:Key="ToolbarTextBlock"
                BasedOn="{StaticResource MaterialDesignTextBlock}"
                TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="StatusbarItem"
                BasedOn="{StaticResource MaterialDesignTextBlock}"
                TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
                <Setter Property="Padding" Value="0" />
            </Style>
            <Style TargetType="{x:Type TextElement}">
                <Setter Property="FontWeight" Value="Regular" />
            </Style>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="FontWeight" Value="Regular" />
            </Style>
            <Style x:Key="lvItemSelected" TargetType="{x:Type ListViewItem}">
                <Setter Property="Margin" Value="2" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListViewItem">
                            <materialDesign:Card Name="_Card" SnapsToDevicePixels="true">
                                <ContentPresenter />
                            </materialDesign:Card>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="true">
                                    <Setter TargetName="_Card" Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="GridViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
                <Setter Property="Height" Value="30" />
            </Style>
            <Style
                x:Key="ListItemCheckBox"
                BasedOn="{StaticResource MaterialDesignUserForegroundCheckBox}"
                TargetType="{x:Type CheckBox}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="DefButton"
                BasedOn="{StaticResource MaterialDesignRaisedButton}"
                TargetType="{x:Type ButtonBase}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="DefContextMenu"
                BasedOn="{StaticResource MaterialDesignContextMenu}"
                TargetType="{x:Type ContextMenu}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
                <Setter Property="FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
            </Style>

            <Style
                x:Key="ToolbarMenu"
                BasedOn="{StaticResource MaterialDesignMenu}"
                TargetType="{x:Type Menu}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
                <Setter Property="FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
            </Style>

            <Style
                x:Key="DefComboBox"
                BasedOn="{StaticResource MaterialDesignComboBox}"
                TargetType="{x:Type ComboBox}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
                <Setter Property="HorizontalAlignment" Value="Left" />
            </Style>
            <Style
                x:Key="DefDataGrid"
                BasedOn="{StaticResource MaterialDesignDataGrid}"
                TargetType="{x:Type DataGrid}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="DefTextBox"
                BasedOn="{StaticResource MaterialDesignTextBox}"
                TargetType="{x:Type TextBox}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="MyOutlinedTextBox"
                BasedOn="{StaticResource MaterialDesignOutlinedTextBox}"
                TargetType="{x:Type TextBox}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
                <Setter Property="Padding" Value="{StaticResource OutlinedTextBoxDefaultPadding}" />
            </Style>
            <Style
                x:Key="MyGroupBox"
                BasedOn="{StaticResource MaterialDesignGroupBox}"
                TargetType="{x:Type GroupBox}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="MyChipListBoxItem"
                BasedOn="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBoxItem}"
                TargetType="{x:Type ListBoxItem}">
                <Setter Property="Margin" Value="-2,0" />
            </Style>
            <Style
                x:Key="MyOutlinedTextComboBox"
                BasedOn="{StaticResource MaterialDesignOutlinedComboBox}"
                TargetType="{x:Type ComboBox}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
                <Setter Property="Padding" Value="{StaticResource OutlinedTextBoxDefaultPadding}" />
            </Style>
            <Style x:Key="ListItemChip" TargetType="{x:Type materialDesign:Chip}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="ListItemTitle"
                BasedOn="{StaticResource MaterialDesignTextBlock}"
                TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="ListItemSubTitle"
                BasedOn="{StaticResource MaterialDesignTextBlock}"
                TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
            </Style>
            <Style
                x:Key="ListItemSubTitle2"
                BasedOn="{StaticResource MaterialDesignTextBlock}"
                TargetType="{x:Type TextBlock}">
                <Setter Property="FontSize" Value="{DynamicResource StdFontSize-1}" />
            </Style>

            <Style
                x:Key="WindowGlobal"
                BasedOn="{StaticResource {x:Type Window}}"
                TargetType="{x:Type Window}">
                <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
                <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
                <Setter Property="TextOptions.TextHintingMode" Value="Fixed" />
                <Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesignBody}" />
                <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}" />
                <Setter Property="TextElement.FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
                <Setter Property="FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
                <Setter Property="ResizeMode" Value="NoResize" />
            </Style>
            <Style
                x:Key="ViewGlobal"
                BasedOn="{StaticResource {x:Type UserControl}}"
                TargetType="{x:Type UserControl}">
                <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
                <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
                <Setter Property="TextOptions.TextHintingMode" Value="Fixed" />
                <Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesignBody}" />
                <Setter Property="Background" Value="{DynamicResource MaterialDesignPaper}" />
                <Setter Property="TextElement.FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
                <Setter Property="FontFamily" Value="{x:Static conv:MaterialDesignFonts.MyFont}" />
            </Style>
        </ResourceDictionary>
    </Application.Resources>
</Application>