<commit_before>﻿<UserControl x:Name="IssueList"
             x:Class="Alteridem.GitHub.Extension.View.IssueListControl"
             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:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:octokit="clr-namespace:Octokit;assembly=Octokit"
             xmlns:converters="clr-namespace:Alteridem.GitHub.Converters;assembly=Alteridem.GitHub"
             xmlns:wpf="clr-namespace:Alteridem.GitHub.Extension.View"
             DataContext="{Binding ElementName=IssueList, Path=GitHubApi}"
             mc:Ignorable="d" 
             d:DesignHeight="500" 
             d:DesignWidth="800">
    <UserControl.Resources>
        <converters:StringToColorConverter x:Key="ColorConverter" />
        <DataTemplate x:Key="RepositoryTemplate">
            <Grid HorizontalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Path=Repository.FullName}" />
                <Border 
                    Grid.Column="1" 
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center" 
                    Background="{DynamicResource {x:Static wpf:Theme.BackgroundAccentKey}}"
                    BorderBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                    CornerRadius="2" 
                    BorderThickness="1" >
                    <TextBlock Text="{Binding Path=Repository.OpenIssuesCount}" Margin="2" FontSize="10" />
                </Border>
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="LabelTemplate">
            <StackPanel Orientation="Horizontal">
                <Border Background="{Binding Path=Color, Converter={StaticResource ColorConverter}}" CornerRadius="2" Width="6" Height="16" Margin="3,0" />
                <TextBlock Margin="3,0" Text="{Binding Path=Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="MilestoneTemplate">
            <Grid HorizontalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Path=Title}" />
                <Border 
                    Grid.Column="1" 
                    HorizontalAlignment="Right" 
                    VerticalAlignment="Center"
                    Background="{DynamicResource {x:Static wpf:Theme.BackgroundAccentKey}}"
                    BorderBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                    CornerRadius="2" 
                    BorderThickness="1" >
                    <TextBlock Text="{Binding Path=OpenIssues}" Margin="2" FontSize="10" />
                </Border>
            </Grid>
        </DataTemplate>
        <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="IssueFilterDataProvider">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="octokit:IssueFilter" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </UserControl.Resources>
    <Grid>
        <Grid.Resources>
            <ResourceDictionary Source="Theme.xaml" />
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="180" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="38"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
            <ComboBox x:Name="Repositories"  Width="200" Height="26" Margin="6,6,3,6" 
                      HorizontalContentAlignment="Stretch"
                      ItemsSource="{Binding Path=Repositories}" 
                      SelectedItem="{Binding Path=Repository}" 
                      ItemTemplate="{StaticResource RepositoryTemplate}"/>
            <!--
            <ComboBox x:Name="Filter" Margin="3,6"
                      Width="120" Height="26"
                      ItemsSource="{Binding Source={StaticResource IssueFilterDataProvider}}"
                      SelectedItem="{Binding Path=Filter}" >
            </ComboBox>
            -->
            <ComboBox x:Name="Label" Margin="3,6"
                      Width="120" Height="26"
                      ItemsSource="{Binding Path=Labels}"
                      SelectedItem="{Binding Path=Label}"
                      ItemTemplate="{StaticResource LabelTemplate}" />
            <ComboBox x:Name="Milestone" Margin="3,6"
                      Width="120" Height="26"
                      HorizontalContentAlignment="Stretch"
                      ItemsSource="{Binding Path=Milestones}"
                      SelectedItem="{Binding Path=Milestone}"
                      ItemTemplate="{StaticResource MilestoneTemplate}" />
        </StackPanel>
        <wpf:GitHubUserControl Grid.Row="0" Grid.Column="1" Width="Auto" HorizontalAlignment="Right"/>
        <DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" 
                  Name="Issues"
                  Margin="6,0,6,6"
                  AutoGenerateColumns="False" 
                  ItemsSource="{Binding Path=Issues}"
                  SelectedItem="{Binding Path=Issue}"
                  FontSize="12"
                  IsReadOnly="True"
                  RowHeaderWidth="0" 
                  MouseDoubleClick="OnOpenIssueViewer"
                  Background="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}"
                  Foreground="{DynamicResource {x:Static wpf:Theme.ForegroundKey}}"
                  RowBackground="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}"
                  AlternatingRowBackground="{DynamicResource {x:Static wpf:Theme.BackgroundAccentKey}}" 
                  HorizontalGridLinesBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                  VerticalGridLinesBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                  BorderBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}" >
            <DataGrid.ColumnHeaderStyle>
                <Style TargetType="DataGridColumnHeader">
                    <Setter Property="Background" Value="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}" />
                    <Setter Property="Margin" Value="2" />
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="FontSize" Value="12" />
                </Style>
            </DataGrid.ColumnHeaderStyle>
            <DataGrid.RowHeaderStyle>
                <Style TargetType="DataGridRowHeader">
                    <Setter Property="Background" Value="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}" />
                    <Setter Property="SeparatorBrush" Value="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}" />
                    <Setter Property="SeparatorVisibility" Value="Visible" />
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="FontSize" Value="12" />
                    <Setter Property="Width" Value="4" />
                </Style>
            </DataGrid.RowHeaderStyle>
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=Number}" Header="" CanUserResize="False">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="Margin" Value="5,0,0,0" />
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding Path=Title}" Header="Title" Width="400" />
                <DataGridTextColumn Binding="{Binding Path=State}" Header="State" CanUserResize="False" />
                <DataGridTextColumn Binding="{Binding Path=Milestone.Title}" Header="Milestone" CanUserResize="False" />
                <DataGridTextColumn Binding="{Binding Path=User.Login}" Header="Reported By" Width="120"/>
                <DataGridTextColumn Binding="{Binding Path=Assignee.Login}" Header="Assigned To" Width="120"/>
                <DataGridTextColumn Binding="{Binding Path=CreatedAt,StringFormat=d}" Header="Created" CanUserResize="False" />
                <DataGridTextColumn Binding="{Binding Path=UpdatedAt,StringFormat=d}" Header="Updated" CanUserResize="False" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl><commit_msg>Give the issue number a bit more space and align right<commit_after>﻿<UserControl x:Name="IssueList"
             x:Class="Alteridem.GitHub.Extension.View.IssueListControl"
             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:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:octokit="clr-namespace:Octokit;assembly=Octokit"
             xmlns:converters="clr-namespace:Alteridem.GitHub.Converters;assembly=Alteridem.GitHub"
             xmlns:wpf="clr-namespace:Alteridem.GitHub.Extension.View"
             DataContext="{Binding ElementName=IssueList, Path=GitHubApi}"
             mc:Ignorable="d" 
             d:DesignHeight="500" 
             d:DesignWidth="800">
    <UserControl.Resources>
        <converters:StringToColorConverter x:Key="ColorConverter" />
        <DataTemplate x:Key="RepositoryTemplate">
            <Grid HorizontalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Path=Repository.FullName}" />
                <Border 
                    Grid.Column="1" 
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center" 
                    Background="{DynamicResource {x:Static wpf:Theme.BackgroundAccentKey}}"
                    BorderBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                    CornerRadius="2" 
                    BorderThickness="1" >
                    <TextBlock Text="{Binding Path=Repository.OpenIssuesCount}" Margin="2" FontSize="10" />
                </Border>
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="LabelTemplate">
            <StackPanel Orientation="Horizontal">
                <Border Background="{Binding Path=Color, Converter={StaticResource ColorConverter}}" CornerRadius="2" Width="6" Height="16" Margin="3,0" />
                <TextBlock Margin="3,0" Text="{Binding Path=Name}"/>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="MilestoneTemplate">
            <Grid HorizontalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Path=Title}" />
                <Border 
                    Grid.Column="1" 
                    HorizontalAlignment="Right" 
                    VerticalAlignment="Center"
                    Background="{DynamicResource {x:Static wpf:Theme.BackgroundAccentKey}}"
                    BorderBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                    CornerRadius="2" 
                    BorderThickness="1" >
                    <TextBlock Text="{Binding Path=OpenIssues}" Margin="2" FontSize="10" />
                </Border>
            </Grid>
        </DataTemplate>
        <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="IssueFilterDataProvider">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="octokit:IssueFilter" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </UserControl.Resources>
    <Grid>
        <Grid.Resources>
            <ResourceDictionary Source="Theme.xaml" />
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="180" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="38"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
            <ComboBox x:Name="Repositories"  Width="200" Height="26" Margin="6,6,3,6" 
                      HorizontalContentAlignment="Stretch"
                      ItemsSource="{Binding Path=Repositories}" 
                      SelectedItem="{Binding Path=Repository}" 
                      ItemTemplate="{StaticResource RepositoryTemplate}"/>
            <!--
            <ComboBox x:Name="Filter" Margin="3,6"
                      Width="120" Height="26"
                      ItemsSource="{Binding Source={StaticResource IssueFilterDataProvider}}"
                      SelectedItem="{Binding Path=Filter}" >
            </ComboBox>
            -->
            <ComboBox x:Name="Label" Margin="3,6"
                      Width="120" Height="26"
                      ItemsSource="{Binding Path=Labels}"
                      SelectedItem="{Binding Path=Label}"
                      ItemTemplate="{StaticResource LabelTemplate}" />
            <ComboBox x:Name="Milestone" Margin="3,6"
                      Width="120" Height="26"
                      HorizontalContentAlignment="Stretch"
                      ItemsSource="{Binding Path=Milestones}"
                      SelectedItem="{Binding Path=Milestone}"
                      ItemTemplate="{StaticResource MilestoneTemplate}" />
        </StackPanel>
        <wpf:GitHubUserControl Grid.Row="0" Grid.Column="1" Width="Auto" HorizontalAlignment="Right"/>
        <DataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" 
                  Name="Issues"
                  Margin="6,0,6,6"
                  AutoGenerateColumns="False" 
                  ItemsSource="{Binding Path=Issues}"
                  SelectedItem="{Binding Path=Issue}"
                  FontSize="12"
                  IsReadOnly="True"
                  RowHeaderWidth="0" 
                  MouseDoubleClick="OnOpenIssueViewer"
                  Background="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}"
                  Foreground="{DynamicResource {x:Static wpf:Theme.ForegroundKey}}"
                  RowBackground="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}"
                  AlternatingRowBackground="{DynamicResource {x:Static wpf:Theme.BackgroundAccentKey}}" 
                  HorizontalGridLinesBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                  VerticalGridLinesBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}"
                  BorderBrush="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}" >
            <DataGrid.ColumnHeaderStyle>
                <Style TargetType="DataGridColumnHeader">
                    <Setter Property="Background" Value="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}" />
                    <Setter Property="Margin" Value="2" />
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="FontSize" Value="12" />
                </Style>
            </DataGrid.ColumnHeaderStyle>
            <DataGrid.RowHeaderStyle>
                <Style TargetType="DataGridRowHeader">
                    <Setter Property="Background" Value="{DynamicResource {x:Static wpf:Theme.BackgroundKey}}" />
                    <Setter Property="SeparatorBrush" Value="{DynamicResource {x:Static wpf:Theme.ControlBorderKey}}" />
                    <Setter Property="SeparatorVisibility" Value="Visible" />
                    <Setter Property="FontWeight" Value="Bold" />
                    <Setter Property="FontSize" Value="12" />
                    <Setter Property="Width" Value="4" />
                </Style>
            </DataGrid.RowHeaderStyle>
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=Number}" Header="" CanUserResize="False">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="{x:Type TextBlock}">
                            <Setter Property="Margin" Value="5,0,5,0" />
                            <Setter Property="HorizontalAlignment" Value="Right"/>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding Path=Title}" Header="Title" Width="400" />
                <DataGridTextColumn Binding="{Binding Path=State}" Header="State" CanUserResize="False" />
                <DataGridTextColumn Binding="{Binding Path=Milestone.Title}" Header="Milestone" CanUserResize="False" />
                <DataGridTextColumn Binding="{Binding Path=User.Login}" Header="Reported By" Width="120"/>
                <DataGridTextColumn Binding="{Binding Path=Assignee.Login}" Header="Assigned To" Width="120"/>
                <DataGridTextColumn Binding="{Binding Path=CreatedAt,StringFormat=d}" Header="Created" CanUserResize="False" />
                <DataGridTextColumn Binding="{Binding Path=UpdatedAt,StringFormat=d}" Header="Updated" CanUserResize="False" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
{'fraction_non_alphanumeric': 0.12178099978359662, 'fraction_numerical': 0.012334992425881843, 'mean_word_length': 2.0782681099084095, 'pattern_counts': {'":': 0, '<': 200, '<?xml version=': 0, '>': 200, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 18}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2546193', 'n_tokens_mistral': 5004, 'n_tokens_neox': 4389, 'n_words': 676}