<commit_before>﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:MahApps.Metro.Controls"
                    xmlns:conv="clr-namespace:MahApps.Metro.Converters"
                    xmlns:Behaviours="clr-namespace:MahApps.Metro.Behaviours"
                    xmlns:Converters="clr-namespace:MahApps.Metro.Converters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.TextBlock.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <conv:ToUpperConverter x:Key="ToUpperConverter" />

    <ControlTemplate x:Key="WindowTemplateKey"
                     TargetType="{x:Type Controls:MetroWindow}">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="LayoutStates">
                    <VisualState x:Name="AfterLoaded">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                           Storyboard.TargetProperty="(UIElement.Opacity)"
                                                           Storyboard.TargetName="PART_Border">
                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                      Value="0" />
                                <SplineDoubleKeyFrame KeyTime="00:00:00.800"
                                                      Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="BeforeLoaded" />
                    <VisualState x:Name="BeforeUnloaded" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <AdornerDecorator>
                <Controls:MetroContentControl IsTabStop="False"
                                              FocusVisualStyle="{x:Null}"
                                              TransitionsEnabled="{TemplateBinding WindowTransitionsEnabled}">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <Rectangle x:Name="PART_WindowTitleBackground"
                                   Fill="{DynamicResource WindowTitleColorBrush}"
                                   Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                                   Visibility="{TemplateBinding ShowTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   Grid.Column="0"
                                   Grid.ColumnSpan="3"
                                   StrokeThickness="0" />

                        <!-- the title bar -->
                        <Grid x:Name="PART_TitleBar"
                              Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                              Visibility="{TemplateBinding ShowTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
                              Grid.Column="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Image Visibility="{TemplateBinding ShowIconOnTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   Source="{TemplateBinding Icon}"
                                   RenderOptions.EdgeMode="Aliased"
                                   RenderOptions.BitmapScalingMode="HighQuality" />
                            <TextBlock x:Name="WindowTitleTextBlock"
                                       Grid.Column="1"
                                       Text="{TemplateBinding Title}"
                                       TextTrimming="CharacterEllipsis"
                                       VerticalAlignment="Center"
                                       Margin="8 -1 0 0"
                                       FontSize="{DynamicResource WindowTitleFontSize}"
                                       FontFamily="{DynamicResource HeaderFontFamily}">
                                <TextBlock.Foreground>
                                    <MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
                                        <Binding ElementName="PART_WindowTitleBackground"
                                                 Path="Fill"
                                                 Mode="OneWay" />
                                        <Binding RelativeSource="{RelativeSource TemplatedParent}"
                                                 Path="TitleForeground"
                                                 Mode="OneWay" />
                                    </MultiBinding>
                                </TextBlock.Foreground>
                            </TextBlock>
                        </Grid>

                        <!-- the window commands -->
                        <ContentPresenter x:Name="PART_WindowCommands"
                                          Content="{Binding WindowCommands, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                                          Panel.ZIndex="1"
                                          Grid.Column="1"
                                          Grid.RowSpan="2"
                                          VerticalAlignment="Top"
                                          Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}" />
                        <!-- the window button commands -->
                        <Controls:WindowButtonCommands x:Name="PART_WindowButtonCommands"
                                                       Panel.ZIndex="1"
                                                       Grid.Column="2"
                                                       Grid.RowSpan="2"
                                                       VerticalAlignment="Top"
                                                       Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}" />

                        <!-- the main window content -->
                        <ContentPresenter Grid.Row="1"
                                          Grid.Column="0"
                                          Grid.ColumnSpan="3" />

                        <!-- flyouts -->
                        <ContentControl Grid.Row="0"
                                        Grid.Column="0"
                                        Grid.ColumnSpan="3"
                                        Grid.RowSpan="2"
                                        Panel.ZIndex="2"
                                        Focusable="False"
                                        KeyboardNavigation.TabNavigation="None"
                                        Content="{Binding Flyouts, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                                        VerticalAlignment="Stretch" />
                    </Grid>
                </Controls:MetroContentControl>
            </AdornerDecorator>
            <Border x:Name="PART_Border"
                    Opacity="0"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch" />
            <ResizeGrip x:Name="WindowResizeGrip"
                        HorizontalAlignment="Right"
                        IsTabStop="false"
                        Visibility="Collapsed"
                        VerticalAlignment="Bottom" />
        </Grid>
        <ControlTemplate.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="ResizeMode"
                               Value="CanResizeWithGrip" />
                    <Condition Property="WindowState"
                               Value="Normal" />
                </MultiTrigger.Conditions>
                <Setter Property="Visibility"
                        TargetName="WindowResizeGrip"
                        Value="Visible" />
            </MultiTrigger>
            <Trigger Property="TitleCaps"
                     Value="True">
                <Setter TargetName="WindowTitleTextBlock"
                        Property="Text"
                        Value="{Binding Path=Title, Converter={StaticResource ToUpperConverter}, RelativeSource={RelativeSource TemplatedParent}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type Controls:MetroWindow}">
        <Setter Property="TextBlockStyle"
                Value="{StaticResource MetroTextBlock}" />
        <Setter Property="Background"
                Value="{DynamicResource WhiteBrush}" />
        <Setter Property="Foreground"
                Value="{DynamicResource BlackBrush}" />
        <Setter Property="Behaviours:StylizedBehaviors.Behaviors">
            <Setter.Value>
                <Behaviours:StylizedBehaviorCollection>
                    <Behaviours:BorderlessWindowBehavior />
                    <Behaviours:WindowsSettingBehaviour />
                    <Behaviours:GlowWindowBehavior />
                </Behaviours:StylizedBehaviorCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="TitleForeground"
                Value="White" /><commit_msg>Fix font size in MetroWindow<commit_after>﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:MahApps.Metro.Controls"
                    xmlns:conv="clr-namespace:MahApps.Metro.Converters"
                    xmlns:Behaviours="clr-namespace:MahApps.Metro.Behaviours"
                    xmlns:Converters="clr-namespace:MahApps.Metro.Converters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.TextBlock.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    <conv:ToUpperConverter x:Key="ToUpperConverter" />

    <ControlTemplate x:Key="WindowTemplateKey"
                     TargetType="{x:Type Controls:MetroWindow}">
        <Grid>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="LayoutStates">
                    <VisualState x:Name="AfterLoaded">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                           Storyboard.TargetProperty="(UIElement.Opacity)"
                                                           Storyboard.TargetName="PART_Border">
                                <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                      Value="0" />
                                <SplineDoubleKeyFrame KeyTime="00:00:00.800"
                                                      Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="BeforeLoaded" />
                    <VisualState x:Name="BeforeUnloaded" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <AdornerDecorator>
                <Controls:MetroContentControl IsTabStop="False"
                                              FocusVisualStyle="{x:Null}"
                                              TransitionsEnabled="{TemplateBinding WindowTransitionsEnabled}">
                    <Grid Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <Rectangle x:Name="PART_WindowTitleBackground"
                                   Fill="{DynamicResource WindowTitleColorBrush}"
                                   Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                                   Visibility="{TemplateBinding ShowTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   Grid.Column="0"
                                   Grid.ColumnSpan="3"
                                   StrokeThickness="0" />

                        <!-- the title bar -->
                        <Grid x:Name="PART_TitleBar"
                              Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                              Visibility="{TemplateBinding ShowTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
                              Grid.Column="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Image Visibility="{TemplateBinding ShowIconOnTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   Source="{TemplateBinding Icon}"
                                   RenderOptions.EdgeMode="Aliased"
                                   RenderOptions.BitmapScalingMode="HighQuality" />
                            <TextBlock x:Name="WindowTitleTextBlock"
                                       Grid.Column="1"
                                       Text="{TemplateBinding Title}"
                                       TextTrimming="CharacterEllipsis"
                                       VerticalAlignment="Center"
                                       Margin="8 -1 0 0"
                                       FontSize="{DynamicResource WindowTitleFontSize}"
                                       FontFamily="{DynamicResource HeaderFontFamily}">
                                <TextBlock.Foreground>
                                    <MultiBinding Converter="{x:Static Converters:BackgroundToForegroundConverter.Instance}">
                                        <Binding ElementName="PART_WindowTitleBackground"
                                                 Path="Fill"
                                                 Mode="OneWay" />
                                        <Binding RelativeSource="{RelativeSource TemplatedParent}"
                                                 Path="TitleForeground"
                                                 Mode="OneWay" />
                                    </MultiBinding>
                                </TextBlock.Foreground>
                            </TextBlock>
                        </Grid>

                        <!-- the window commands -->
                        <ContentPresenter x:Name="PART_WindowCommands"
                                          Content="{Binding WindowCommands, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                                          Panel.ZIndex="1"
                                          Grid.Column="1"
                                          Grid.RowSpan="2"
                                          VerticalAlignment="Top"
                                          Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}" />
                        <!-- the window button commands -->
                        <Controls:WindowButtonCommands x:Name="PART_WindowButtonCommands"
                                                       Panel.ZIndex="1"
                                                       Grid.Column="2"
                                                       Grid.RowSpan="2"
                                                       VerticalAlignment="Top"
                                                       Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}" />

                        <!-- the main window content -->
                        <ContentPresenter Grid.Row="1"
                                          Grid.Column="0"
                                          Grid.ColumnSpan="3" />

                        <!-- flyouts -->
                        <ContentControl Grid.Row="0"
                                        Grid.Column="0"
                                        Grid.ColumnSpan="3"
                                        Grid.RowSpan="2"
                                        Panel.ZIndex="2"
                                        Focusable="False"
                                        KeyboardNavigation.TabNavigation="None"
                                        Content="{Binding Flyouts, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
                                        VerticalAlignment="Stretch" />
                    </Grid>
                </Controls:MetroContentControl>
            </AdornerDecorator>
            <Border x:Name="PART_Border"
                    Opacity="0"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch" />
            <ResizeGrip x:Name="WindowResizeGrip"
                        HorizontalAlignment="Right"
                        IsTabStop="false"
                        Visibility="Collapsed"
                        VerticalAlignment="Bottom" />
        </Grid>
        <ControlTemplate.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="ResizeMode"
                               Value="CanResizeWithGrip" />
                    <Condition Property="WindowState"
                               Value="Normal" />
                </MultiTrigger.Conditions>
                <Setter Property="Visibility"
                        TargetName="WindowResizeGrip"
                        Value="Visible" />
            </MultiTrigger>
            <Trigger Property="TitleCaps"
                     Value="True">
                <Setter TargetName="WindowTitleTextBlock"
                        Property="Text"
                        Value="{Binding Path=Title, Converter={StaticResource ToUpperConverter}, RelativeSource={RelativeSource TemplatedParent}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type Controls:MetroWindow}">
        <Setter Property="TextBlockStyle"
                Value="{StaticResource MetroTextBlock}" />
        <Setter Property="TextBlock.FontSize"
                Value="{DynamicResource ContentFontSize}"/>
        <Setter Property="Background"
                Value="{DynamicResource WhiteBrush}" />
        <Setter Property="Foreground"
                Value="{DynamicResource BlackBrush}" />
        <Setter Property="Behaviours:StylizedBehaviors.Behaviors">
            <Setter.Value>
                <Behaviours:StylizedBehaviorCollection>
                    <Behaviours:BorderlessWindowBehavior />
                    <Behaviours:WindowsSettingBehaviour />
                    <Behaviours:GlowWindowBehavior />
                </Behaviours:StylizedBehaviorCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="TitleForeground"
                Value="White" />
{'fraction_non_alphanumeric': 0.08600454608711787, 'fraction_numerical': 0.005102750846592754, 'mean_word_length': 1.1742813918305597, 'pattern_counts': {'":': 0, '<': 188, '<?xml version=': 0, '>': 188, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 148, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5433727', 'n_tokens_mistral': 4560, 'n_tokens_neox': 4105, 'n_words': 590}