<commit_before>﻿<UserControl x:Class="CramTool.Views.SearchTextBox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             x:Name="This"
             mc:Ignorable="d"
             d:DesignWidth="300">
    <Border>
        <Border.Style>
            <Style TargetType="Border">
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Padding" Value="1"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ElementName=UxTextBox, Path=IsFocused}" Value="True">
                        <Setter Property="BorderBrush">
                            <Setter.Value>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                    <GradientStop Color="#FF4581B1" />
                                    <GradientStop Color="#FFB7D9ED" Offset="1"/>
                                </LinearGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ElementName=UxTextBox, Path=IsFocused}" Value="False">
                        <Setter Property="BorderBrush">
                            <Setter.Value>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                    <GradientStop Color="#FFAFB1B7" />
                                    <GradientStop Color="#FFE3E9EF" Offset="1"/>
                                </LinearGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Border.Style>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="0" x:Name="UxTextBox" Text="{Binding ElementName=This, Path=Text, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0"/>
            <Button Grid.Column="1" x:Name="UxButton" Focusable="False" Click="OnClearButtonPressed"
                    Width="{Binding ElementName=UxTextBox, Path=ActualHeight}"
                    ToolTip="Clear field">
                <Button.Template>
                    <ControlTemplate>
                        <Border>
                            <Border.Style>
                                <Style TargetType="Border">
                                    <Setter Property="BorderThickness" Value="0"/>
                                    <Style.Triggers>
                                        <MultiDataTrigger>
                                            <MultiDataTrigger.Conditions>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsMouseOver}" Value="True"/>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsPressed}" Value="False"/>
                                            </MultiDataTrigger.Conditions>
                                            <Setter Property="Background">
                                                <Setter.Value>
                                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                                        <GradientStop Color="#FFB7D9ED" />
                                                        <GradientStop Color="#FFE3E9EF" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Setter.Value>
                                            </Setter>
                                        </MultiDataTrigger>
                                        <MultiDataTrigger>
                                            <MultiDataTrigger.Conditions>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsMouseOver}" Value="False"/>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsPressed}" Value="False"/>
                                            </MultiDataTrigger.Conditions>
                                            <Setter Property="Background" Value="White"/>
                                        </MultiDataTrigger>
                                        <MultiDataTrigger>
                                            <MultiDataTrigger.Conditions>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsPressed}" Value="True"/>
                                            </MultiDataTrigger.Conditions>
                                            <Setter Property="Background">
                                                <Setter.Value>
                                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                                        <GradientStop Color="#FF4581B1" />
                                                        <GradientStop Color="#FFB7D9ED" Offset="1"/>
                                                    </LinearGradientBrush>
                                                </Setter.Value>
                                            </Setter>
                                        </MultiDataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Border.Style>
                            <Image Source="{StaticResource ClearTextBoxIcon}" Height="16"/>
                        </Border>
                    </ControlTemplate>
                </Button.Template>
            </Button>
        </Grid>
    </Border>
</UserControl><commit_msg>Moved SearchTextBox brushes to resources.<commit_after>﻿<UserControl x:Class="CramTool.Views.SearchTextBox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             x:Name="This"
             mc:Ignorable="d"
             d:DesignWidth="300">
    <UserControl.Resources>
        
        <LinearGradientBrush x:Key="TextBoxActiveBorderBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FF4581B1" />
            <GradientStop Color="#FFB7D9ED" Offset="1"/>
        </LinearGradientBrush>
        
        <LinearGradientBrush x:Key="TextBoxInactiveBorderBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FFAFB1B7" />
            <GradientStop Color="#FFE3E9EF" Offset="1"/>
        </LinearGradientBrush>

        <SolidColorBrush x:Key="ButtonDefaultBackground" Color="White"/>

        <LinearGradientBrush x:Key="ButtonHighlightBackground" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FFB7D9ED" />
            <GradientStop Color="#FFE3E9EF" Offset="1"/>
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="ButtonPressedBackground" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FF4581B1" />
            <GradientStop Color="#FFB7D9ED" Offset="1"/>
        </LinearGradientBrush>

    </UserControl.Resources>
    <Border>
        <Border.Style>
            <Style TargetType="Border">
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Padding" Value="1"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ElementName=UxTextBox, Path=IsFocused}" Value="True">
                        <Setter Property="BorderBrush" Value="{StaticResource TextBoxActiveBorderBrush}"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ElementName=UxTextBox, Path=IsFocused}" Value="False">
                        <Setter Property="BorderBrush" Value="{StaticResource TextBoxInactiveBorderBrush}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Border.Style>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <TextBox Grid.Column="0" x:Name="UxTextBox" Text="{Binding ElementName=This, Path=Text, UpdateSourceTrigger=PropertyChanged}" BorderThickness="0"/>
            <Button Grid.Column="1" x:Name="UxButton" Focusable="False" Click="OnClearButtonPressed"
                    Width="{Binding ElementName=UxTextBox, Path=ActualHeight}"
                    ToolTip="Clear field">
                <Button.Template>
                    <ControlTemplate>
                        <Border>
                            <Border.Style>
                                <Style TargetType="Border">
                                    <Setter Property="BorderThickness" Value="0"/>
                                    <Style.Triggers>
                                        <MultiDataTrigger>
                                            <MultiDataTrigger.Conditions>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsMouseOver}" Value="False"/>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsPressed}" Value="False"/>
                                            </MultiDataTrigger.Conditions>
                                            <Setter Property="Background" Value="{StaticResource ButtonDefaultBackground}"/>
                                        </MultiDataTrigger>
                                        <MultiDataTrigger>
                                            <MultiDataTrigger.Conditions>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsMouseOver}" Value="True"/>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsPressed}" Value="False"/>
                                            </MultiDataTrigger.Conditions>
                                            <Setter Property="Background" Value="{StaticResource ButtonHighlightBackground}"/>
                                        </MultiDataTrigger>
                                        <MultiDataTrigger>
                                            <MultiDataTrigger.Conditions>
                                                <Condition Binding="{Binding ElementName=UxButton, Path=IsPressed}" Value="True"/>
                                            </MultiDataTrigger.Conditions>
                                            <Setter Property="Background" Value="{StaticResource ButtonPressedBackground}"/>
                                        </MultiDataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Border.Style>
                            <Image Source="{StaticResource ClearTextBoxIcon}" Height="16"/>
                        </Border>
                    </ControlTemplate>
                </Button.Template>
            </Button>
        </Grid>
    </Border>
</UserControl>
{'fraction_non_alphanumeric': 0.10025273799494525, 'fraction_numerical': 0.011625947767481045, 'mean_word_length': 1.1209576558870824, 'pattern_counts': {'":': 0, '<': 172, '<?xml version=': 0, '>': 172, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 106, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6803804', 'n_tokens_mistral': 2624, 'n_tokens_neox': 2306, 'n_words': 369}