<commit_before>﻿<Window x:Class="ExtensionManager.Views.ExtensionBrowser"
        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"
        xmlns:viewModels="clr-namespace:ExtensionManager.ViewModels"
        mc:Ignorable="d" 
        ShowInTaskbar="False"
        d:DataContext="{d:DesignInstance Type=viewModels:ExtensionBrowserViewModel, IsDesignTimeCreatable=True}"
        Title="Extension Browser" 
        Topmost="True" 
        WindowStyle="ToolWindow" Padding="4" Width="752" Margin="0">
    <Window.Resources>
        <Style TargetType="{x:Type Button}" x:Key="IsInstalledHideShowInverse">
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsInstalled, Mode=OneWay}" Value="True">
                    <Setter Property="Visibility" Value="Hidden" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="{x:Type Button}" x:Key="IsInstalledHideShow">
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsInstalled, Mode=OneWay}" Value="False">
                    <Setter Property="Visibility" Value="Hidden" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="{x:Type Button}" x:Key="IsUpgradeAvailable">
            <Style.Triggers>
                <DataTrigger Binding="{Binding UpgradeAvailable, Mode=OneWay}" Value="False">
                    <Setter Property="Visibility" Value="Hidden" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="105" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Grid.ColumnSpan="2"  VerticalAlignment="Center" Padding="2" Margin="0,0,0,4" BorderBrush="Black" BorderThickness="0,0,0,1" >
            <StackPanel>
                <Label DockPanel.Dock="Left" Content="Browse and Manage Extensions" FontSize="21" FontWeight="Bold" />
                <DockPanel>
                    <Button DockPanel.Dock="Right" Content="Refresh List" Click="refreshButton_Click" Padding="3" Margin="6" HorizontalAlignment="Right"     />
                    <ProgressBar DockPanel.Dock="Bottom" DataContext="{Binding DataContext, ElementName=dataGrid}" Height="25" Margin="6" Padding="6" IsIndeterminate="{Binding ShowProgress}" />
                </DockPanel>
            </StackPanel>
        </Border>
        <DockPanel Grid.Column="0" Grid.Row="1">
            <DataGrid x:Name="dataGrid" MinHeight="150" ItemsSource="{Binding Extensions}" CanUserDeleteRows="False" AutoGenerateColumns="False" 
        		CanUserAddRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" 
        		CanUserResizeColumns="False" GridLinesVisibility="None" SelectionMode="Single" SelectedIndex="0" HeadersVisibility="None">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Width="45">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="viewModels:ExtensionRowViewModel">
                                <Image Source="{Binding PackageMetadata.IconUrl}" Margin="7,5"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Binding="{Binding PackageMetadata.Title, Mode=OneWay}" Width="*"/>
                    <!--<DataGridTextColumn Binding="{Binding PackageMetadata.Version, Mode=OneWay}" Header="Version" />-->
                    <DataGridTemplateColumn Width=".75*">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="viewModels:ExtensionRowViewModel">
                                <StackPanel Orientation="Horizontal">
                                    <Button Command="{Binding DataContext.AddExtensionCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Content="Add" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" Padding="3" CommandParameter="{Binding DataContext, Mode=OneWay, RelativeSource={RelativeSource Self}}" Style="{DynamicResource IsInstalledHideShowInverse}" />
                                    <Button Command="{Binding DataContext.UpdateExtensionCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Content="Update" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" Padding="3" CommandParameter="{Binding DataContext, Mode=OneWay, RelativeSource={RelativeSource Self}}" Style="{DynamicResource IsUpgradeAvailable }"  />
                                    <Button Command="{Binding DataContext.RemoveExtensionCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Content="Remove" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" Padding="3" CommandParameter="{Binding DataContext, Mode=OneWay, RelativeSource={RelativeSource Self}}" Style="{DynamicResource IsInstalledHideShow}"  />
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn><commit_msg>simplified XAML by removing default properties that don't have any effect.<commit_after>﻿<Window x:Class="ExtensionManager.Views.ExtensionBrowser"
        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"
        xmlns:viewModels="clr-namespace:ExtensionManager.ViewModels"
        mc:Ignorable="d" 
        ShowInTaskbar="False"
        d:DataContext="{d:DesignInstance Type=viewModels:ExtensionBrowserViewModel, IsDesignTimeCreatable=True}"
        Title="Extension Browser" 
        Topmost="True" 
        WindowStyle="ToolWindow" Padding="4" Width="752" Margin="0">
    <Window.Resources>
        <Style TargetType="{x:Type Button}" x:Key="IsInstalledHideShowInverse">
            <Style.Triggers>
                <DataTrigger Binding="{Binding (viewModels:ExtensionRowViewModel.IsInstalled)}" Value="True">
                    <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="{x:Type Button}" x:Key="IsInstalledHideShow">
            <Style.Triggers>
                <DataTrigger Binding="{Binding (viewModels:ExtensionRowViewModel.IsInstalled)}" Value="False">
                    <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="{x:Type Button}" x:Key="IsUpgradeAvailable">
            <Style.Triggers>
                <DataTrigger Binding="{Binding (viewModels:ExtensionRowViewModel.UpdateAvailable)}" Value="False">
                    <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="105" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Grid.ColumnSpan="2"  VerticalAlignment="Center" Padding="2" Margin="0,0,0,4" BorderBrush="Black" BorderThickness="0,0,0,1" >
            <StackPanel>
                <Label DockPanel.Dock="Left" Content="Browse and Manage Extensions" FontSize="21" FontWeight="Bold" />
                <DockPanel>
                    <Button DockPanel.Dock="Right" Content="Refresh List" Click="refreshButton_Click" Padding="3" Margin="6" HorizontalAlignment="Right"     />
                    <ProgressBar DockPanel.Dock="Bottom" DataContext="{Binding DataContext, ElementName=dataGrid}" Height="25" Margin="6" Padding="6" IsIndeterminate="{Binding ShowProgress}" />
                </DockPanel>
            </StackPanel>
        </Border>
        <DockPanel Grid.Column="0" Grid.Row="1">
            <DataGrid x:Name="dataGrid" MinHeight="150" ItemsSource="{Binding Extensions}" CanUserDeleteRows="False" AutoGenerateColumns="False" 
        		CanUserAddRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" 
        		CanUserResizeColumns="False" GridLinesVisibility="None" SelectionMode="Single" SelectedIndex="0" HeadersVisibility="None">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Width="45">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="viewModels:ExtensionRowViewModel">
                                <Image Source="{Binding PackageMetadata.IconUrl}" Margin="7,5"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Binding="{Binding PackageMetadata.Title, Mode=OneWay}" Width="*"/>
                    <!--<DataGridTextColumn Binding="{Binding PackageMetadata.Version, Mode=OneWay}" Header="Version" />-->
                    <DataGridTemplateColumn Width=".75*">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate DataType="viewModels:ExtensionRowViewModel">
                                <StackPanel Orientation="Horizontal">
                                    <Button Command="{Binding DataContext.AddExtensionCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Content="Add" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" Padding="3" CommandParameter="{Binding DataContext, RelativeSource={RelativeSource Self}}" Style="{DynamicResource IsInstalledHideShowInverse}" />
                                    <Button Command="{Binding DataContext.UpdateExtensionCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Content="Update" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" Padding="3" CommandParameter="{Binding DataContext, RelativeSource={RelativeSource Self}}" Style="{DynamicResource IsUpgradeAvailable }"  />
                                    <Button Command="{Binding DataContext.RemoveExtensionCommand, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Content="Remove" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="2" Padding="3" CommandParameter="{Binding DataContext, RelativeSource={RelativeSource Self}}" Style="{DynamicResource IsInstalledHideShow}"  />
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
{'fraction_non_alphanumeric': 0.12194281777471581, 'fraction_numerical': 0.010506372717878057, 'mean_word_length': 2.7546071774975753, 'pattern_counts': {'":': 0, '<': 137, '<?xml version=': 0, '>': 137, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6636480', 'n_tokens_mistral': 3084, 'n_tokens_neox': 2811, 'n_words': 457}