<commit_before>﻿<Window x:Class="Example.FontAwesome.WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        xmlns:viewModel="clr-namespace:Example.FontAwesome.WPF.ViewModel"
        xmlns:fa="http://schemas.fontawesome.io/icons/"
        Title="FontAwesome WPF Example" Height="700" Width="780">
    <Window.DataContext>
        <viewModel:MainViewModel/>
    </Window.DataContext>
    <Window.Resources>
        
        
        <CollectionViewSource x:Key="IconSource" Source="{Binding Path=Icons}" Filter="IconSource_OnFilter">
            <CollectionViewSource.SortDescriptions>
                <componentModel:SortDescription PropertyName="Category" />
                <componentModel:SortDescription PropertyName="Description" />
            </CollectionViewSource.SortDescriptions>
            <CollectionViewSource.GroupDescriptions>
                <PropertyGroupDescription PropertyName="Category" />
            </CollectionViewSource.GroupDescriptions>
        </CollectionViewSource>

        <DataTemplate DataType="{x:Type viewModel:IconDescription}">
            <Grid Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <fa:FontAwesome
                            Icon="{Binding Path=Icon}"
                            FontSize="{Binding ElementName=FontSizeSlider, Path=Value}"
                            VerticalAlignment="Center" Margin="0,0,10,0" />
                <TextBlock Text="{Binding Path=Icon}" Grid.Column="1" VerticalAlignment="Center" />
            </Grid>
        </DataTemplate>

        <x:Array x:Key="FlipOrientationArray" Type="fa:FlipOrientation">
            <fa:FlipOrientation>Normal</fa:FlipOrientation>
            <fa:FlipOrientation>Horizontal</fa:FlipOrientation>
            <fa:FlipOrientation>Vertical</fa:FlipOrientation>
        </x:Array>

        <SolidColorBrush x:Key="ImageBrush"  Color="LightBlue" />

    </Window.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="3*" />
        </Grid.ColumnDefinitions>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2">
            <Label Content="Font-Size: " />
            <Slider Width="150" VerticalAlignment="Center" Value="30" Minimum="10" Maximum="50" x:Name="FontSizeSlider" />
            <TextBlock Text="{Binding ElementName=FontSizeSlider, Path=Value, StringFormat={}{0:00.00}}" VerticalAlignment="Center" />
            <Rectangle Margin="10,2" Fill="LightGray" Width="1" />
            <Label Content="Spin: " />
            <CheckBox VerticalAlignment="Center" x:Name="IconSpin" Margin="0,0,5,0" />
            <Slider Width="100" VerticalAlignment="Center" Value="1" Minimum="0" Maximum="5" TickFrequency="1" SmallChange="1" LargeChange="2" IsSnapToTickEnabled="True" x:Name="SpinDurationSlider" />
            <Rectangle Margin="10,2" Fill="LightGray" Width="1" />
            <Label Content="Rotation: " />
            <Slider Width="150" VerticalAlignment="Center" Value="0" Minimum="0" Maximum="360" Ticks="0,45,90,135,180,225,270,315,360" TickPlacement="BottomRight" IsSnapToTickEnabled="True" x:Name="RotationSlider" AutoToolTipPlacement="TopLeft" />
            <Label Content="Flip: " />
            <ComboBox VerticalAlignment="Center" Width="100" ItemsSource="{StaticResource FlipOrientationArray}" SelectedIndex="0" x:Name="FlipOrientationSelector" />
        </StackPanel>

        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Label Content="Filter: " />
            <TextBox Width="150" Margin="0,3" x:Name="FilterText" TextChanged="FilterText_OnTextChanged" />
        </StackPanel>

        <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
            <Button Content="Show Single" Margin="0,3" Click="ButtonBase_OnClick" />
            <Button Content="Show Animated" Margin="3,3,3,3" Click="ButtonBase_OnClickAnimated" />
        </StackPanel>

        <ListView Grid.Row="2" ItemsSource="{Binding Source={StaticResource ResourceKey=IconSource}}" x:Name="FaListView" SelectedIndex="0">
            <ListView.GroupStyle>
                <GroupStyle>
                    <GroupStyle.ContainerStyle>
                        <Style TargetType="{x:Type GroupItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Expander IsExpanded="True">
                                            <Expander.Header>
                                                <StackPanel Orientation="Horizontal">
                                                    <TextBlock Text="{Binding Name}" FontWeight="Bold" VerticalAlignment="Bottom" />
                                                    <TextBlock Text="{Binding ItemCount, StringFormat={}({0})}"  Margin="10,0,0,0" VerticalAlignment="Bottom" />
                                                </StackPanel>
                                            </Expander.Header>
                                            <ItemsPresenter Margin="20,0,0,0" />
                                        </Expander>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </GroupStyle.ContainerStyle>
                </GroupStyle>
            </ListView.GroupStyle>
        </ListView>

        <StackPanel Grid.Row="2" Grid.Column="1" Margin="10">

            <TextBlock 
                Text="{Binding Path=Description}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                FontSize="20"
                Margin="0,0,0,20"
                />

            <fa:FontAwesome 
                    Icon="{Binding Path=Icon}"
                    DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                    FontSize="90" HorizontalAlignment="Center"
                    Rotation="{Binding ElementName=RotationSlider, Path=Value, Mode=OneWay}"
                    FlipOrientation="{Binding ElementName=FlipOrientationSelector, Path=SelectedItem, Mode=OneWay}"
                    SpinDuration="{Binding ElementName=SpinDurationSlider, Path=Value, Mode=OneWay}"
                    Spin="{Binding ElementName=IconSpin, Path=IsChecked}" Foreground="#ff222222" />

            <TextBlock 
                Text="{Binding Path=Icon, StringFormat='&lt;fa:FontAwesome Icon=&quot;{0}&quot; FontSize=&quot;100&quot; /&gt;'}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                />

            <fa:ImageAwesome 
                Icon="{Binding Path=Icon}" Width="50" Height="50" Foreground="Red"
                Rotation="{Binding ElementName=RotationSlider, Path=Value, Mode=OneWay}"
                FlipOrientation="{Binding ElementName=FlipOrientationSelector, Path=SelectedItem, Mode=OneWay}"
                SpinDuration="{Binding ElementName=SpinDurationSlider, Path=Value, Mode=OneWay}"
                Spin="{Binding ElementName=IconSpin, Path=IsChecked}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                />

            <TextBlock 
                Text="{Binding Path=Icon, StringFormat='&lt;fa:ImageAwesome Icon=&quot;{0}&quot; Width=&quot;50&quot; Height=&quot;50&quot; /&gt;'}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                />

            <TextBlock 
                Text="Using a converter:"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                />

            <fa:FontAwesome 
                    Icon="{Binding Path=Id, StringFormat='Font Awesome CSS class name: &quot;{0}&quot;', Converter={fa:CssClassNameConverter}}"
                    DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                    FontSize="50" HorizontalAlignment="Center"
                    Rotation="{Binding ElementName=RotationSlider, Path=Value, Mode=OneWay}"
                    FlipOrientation="{Binding ElementName=FlipOrientationSelector, Path=SelectedItem, Mode=OneWay}"
                    SpinDuration="{Binding ElementName=SpinDurationSlider, Path=Value, Mode=OneWay}"
                    Spin="{Binding ElementName=IconSpin, Path=IsChecked}" Foreground="#ff222222" />


            <TextBlock 
                Text="{Binding Path=Icon, StringFormat='Font Awesome CSS class name: &quot;{0}&quot;', Converter={StaticResource FromIconClassNameConverter}}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                /><commit_msg>Add opacity slider to WPF example app<commit_after>﻿<Window x:Class="Example.FontAwesome.WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        xmlns:viewModel="clr-namespace:Example.FontAwesome.WPF.ViewModel"
        xmlns:fa="http://schemas.fontawesome.io/icons/"
        Title="FontAwesome WPF Example" Height="700" Width="950">
    <Window.DataContext>
        <viewModel:MainViewModel/>
    </Window.DataContext>
    <Window.Resources>
        
        
        <CollectionViewSource x:Key="IconSource" Source="{Binding Path=Icons}" Filter="IconSource_OnFilter">
            <CollectionViewSource.SortDescriptions>
                <componentModel:SortDescription PropertyName="Category" />
                <componentModel:SortDescription PropertyName="Description" />
            </CollectionViewSource.SortDescriptions>
            <CollectionViewSource.GroupDescriptions>
                <PropertyGroupDescription PropertyName="Category" />
            </CollectionViewSource.GroupDescriptions>
        </CollectionViewSource>

        <DataTemplate DataType="{x:Type viewModel:IconDescription}">
            <Grid Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <fa:FontAwesome
                            Icon="{Binding Path=Icon}"
                            FontSize="{Binding ElementName=FontSizeSlider, Path=Value}"
                            VerticalAlignment="Center" Margin="0,0,10,0" />
                <TextBlock Text="{Binding Path=Icon}" Grid.Column="1" VerticalAlignment="Center" />
            </Grid>
        </DataTemplate>

        <x:Array x:Key="FlipOrientationArray" Type="fa:FlipOrientation">
            <fa:FlipOrientation>Normal</fa:FlipOrientation>
            <fa:FlipOrientation>Horizontal</fa:FlipOrientation>
            <fa:FlipOrientation>Vertical</fa:FlipOrientation>
        </x:Array>

        <SolidColorBrush x:Key="ImageBrush"  Color="LightBlue" />

    </Window.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="3*" />
        </Grid.ColumnDefinitions>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2">
            <Label Content="Font-Size: " />
            <Slider Width="150" VerticalAlignment="Center" Value="30" Minimum="10" Maximum="50" x:Name="FontSizeSlider" />
            <TextBlock Text="{Binding ElementName=FontSizeSlider, Path=Value, StringFormat={}{0:00.00}}" VerticalAlignment="Center" />
            <Rectangle Margin="10,2" Fill="LightGray" Width="1" />
            <Label Content="Spin: " />
            <CheckBox VerticalAlignment="Center" x:Name="IconSpin" Margin="0,0,5,0" />
            <Slider Width="100" VerticalAlignment="Center" Value="1" Minimum="0" Maximum="5" TickFrequency="1" SmallChange="1" LargeChange="2" IsSnapToTickEnabled="True" x:Name="SpinDurationSlider" />
            <Rectangle Margin="10,2" Fill="LightGray" Width="1" />
            <Label Content="Rotation: " />
            <Slider Width="150" VerticalAlignment="Center" Value="0" Minimum="0" Maximum="360" Ticks="0,45,90,135,180,225,270,315,360" TickPlacement="BottomRight" IsSnapToTickEnabled="True" x:Name="RotationSlider" AutoToolTipPlacement="TopLeft" />
            <Rectangle Margin="10,2" Fill="LightGray" Width="1" />
            <Label Content="Opacity: " />
            <Slider Width="50" VerticalAlignment="Center" Value="1" Minimum="0" Maximum="1" x:Name="OpacitySlider" />
            <Label Content="Flip: " />
            <ComboBox VerticalAlignment="Center" Width="100" ItemsSource="{StaticResource FlipOrientationArray}" SelectedIndex="0" x:Name="FlipOrientationSelector" />
        </StackPanel>

        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Label Content="Filter: " />
            <TextBox Width="150" Margin="0,3" x:Name="FilterText" TextChanged="FilterText_OnTextChanged" />
        </StackPanel>

        <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
            <Button Content="Show Single" Margin="0,3" Click="ButtonBase_OnClick" />
            <Button Content="Show Animated" Margin="3,3,3,3" Click="ButtonBase_OnClickAnimated" />
        </StackPanel>

        <ListView Grid.Row="2" ItemsSource="{Binding Source={StaticResource ResourceKey=IconSource}}" x:Name="FaListView" SelectedIndex="0">
            <ListView.GroupStyle>
                <GroupStyle>
                    <GroupStyle.ContainerStyle>
                        <Style TargetType="{x:Type GroupItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Expander IsExpanded="True">
                                            <Expander.Header>
                                                <StackPanel Orientation="Horizontal">
                                                    <TextBlock Text="{Binding Name}" FontWeight="Bold" VerticalAlignment="Bottom" />
                                                    <TextBlock Text="{Binding ItemCount, StringFormat={}({0})}"  Margin="10,0,0,0" VerticalAlignment="Bottom" />
                                                </StackPanel>
                                            </Expander.Header>
                                            <ItemsPresenter Margin="20,0,0,0" />
                                        </Expander>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </GroupStyle.ContainerStyle>
                </GroupStyle>
            </ListView.GroupStyle>
        </ListView>

        <StackPanel Grid.Row="2" Grid.Column="1" Margin="10">

            <TextBlock 
                Text="{Binding Path=Description}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                FontSize="20"
                Margin="0,0,0,20"
                />

            <fa:FontAwesome 
                    Icon="{Binding Path=Icon}"
                    DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                    FontSize="90" HorizontalAlignment="Center"
                    Opacity="{Binding ElementName=OpacitySlider, Path=Value, Mode=OneWay}"
                    Rotation="{Binding ElementName=RotationSlider, Path=Value, Mode=OneWay}"
                    FlipOrientation="{Binding ElementName=FlipOrientationSelector, Path=SelectedItem, Mode=OneWay}"
                    SpinDuration="{Binding ElementName=SpinDurationSlider, Path=Value, Mode=OneWay}"
                    Spin="{Binding ElementName=IconSpin, Path=IsChecked}" Foreground="#ff222222" />

            <TextBlock 
                Text="{Binding Path=Icon, StringFormat='&lt;fa:FontAwesome Icon=&quot;{0}&quot; FontSize=&quot;100&quot; /&gt;'}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                />

            <fa:ImageAwesome 
                Icon="{Binding Path=Icon}" Width="50" Height="50" Foreground="Red"
                Opacity="{Binding ElementName=OpacitySlider, Path=Value, Mode=OneWay}"
                Rotation="{Binding ElementName=RotationSlider, Path=Value, Mode=OneWay}"
                FlipOrientation="{Binding ElementName=FlipOrientationSelector, Path=SelectedItem, Mode=OneWay}"
                SpinDuration="{Binding ElementName=SpinDurationSlider, Path=Value, Mode=OneWay}"
                Spin="{Binding ElementName=IconSpin, Path=IsChecked}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                />

            <TextBlock 
                Text="{Binding Path=Icon, StringFormat='&lt;fa:ImageAwesome Icon=&quot;{0}&quot; Width=&quot;50&quot; Height=&quot;50&quot; /&gt;'}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                />

            <TextBlock 
                Text="Using a converter:"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                />

            <fa:FontAwesome 
                    Icon="{Binding Path=Id, StringFormat='Font Awesome CSS class name: &quot;{0}&quot;', Converter={fa:CssClassNameConverter}}"
                    DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                    FontSize="50" HorizontalAlignment="Center"
                    Opacity="{Binding ElementName=OpacitySlider, Path=Value, Mode=OneWay}"
                    Rotation="{Binding ElementName=RotationSlider, Path=Value, Mode=OneWay}"
                    FlipOrientation="{Binding ElementName=FlipOrientationSelector, Path=SelectedItem, Mode=OneWay}"
                    SpinDuration="{Binding ElementName=SpinDurationSlider, Path=Value, Mode=OneWay}"
                    Spin="{Binding ElementName=IconSpin, Path=IsChecked}" Foreground="#ff222222" />


            <TextBlock 
                Text="{Binding Path=Icon, StringFormat='Font Awesome CSS class name: &quot;{0}&quot;', Converter={StaticResource FromIconClassNameConverter}}"
                DataContext="{Binding ElementName=FaListView, Path=SelectedItem}"
                TextAlignment="Center"
                TextWrapping="Wrap"
                FontFamily="Consolas"
                Margin="0,20"
                />
{'fraction_non_alphanumeric': 0.1238384035997261, 'fraction_numerical': 0.018340995793798297, 'mean_word_length': 2.1135982945028173, 'pattern_counts': {'":': 0, '<': 206, '<?xml version=': 0, '>': 206, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4817980', 'n_tokens_mistral': 5677, 'n_tokens_neox': 4971, 'n_words': 775}