<commit_before>﻿<ResourceDictionary
    x:Class="Audiotica.Windows.DataTemplates.LibraryDictionary"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Audiotica.Windows.Controls"
    xmlns:databaseModels="using:Audiotica.Database.Models"
    xmlns:webModels="using:Audiotica.Web.Models">
    
    <DataTemplate x:Key="TrackTemplate" x:DataType="databaseModels:Track">
        <controls:TrackViewer Track="{x:Bind}"
                              IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>

    <DataTemplate x:Key="CatalogTrackTemplate" x:DataType="databaseModels:Track">
        <controls:TrackViewer Track="{x:Bind}"
                              IsCatalog="True"
                              IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>

    <DataTemplate x:Key="TrackNarrowTemplate" x:DataType="databaseModels:Track">
        <controls:TrackNarrowViewer Track="{x:Bind}"
                                    IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>
    <DataTemplate x:Key="CatalogTrackNarrowTemplate" x:DataType="databaseModels:Track">
        <controls:TrackNarrowViewer Track="{x:Bind}"
                                    IsCatalog="True"
                                    IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>

    <DataTemplate x:Key="AlbumTemplate" x:DataType="databaseModels:Album">
        <StackPanel Width="140" Height="210" Margin="4">
            <Grid Width="140" Height="140" Background="{ThemeResource SystemControlBackgroundAccentBrush}"
                  Margin="0,0,0,5">
                <Image Source="{x:Bind ArtworkUri, Converter={StaticResource ImageSourceConverter}}"
                       Stretch="UniformToFill" />
            </Grid>
            <TextBlock Text="{x:Bind Title}" TextWrapping="Wrap" Margin="0,0,0,5"
                       MaxHeight="40" LineHeight="20" LineStackingStrategy="BlockLineHeight" />
            <TextBlock Text="{x:Bind Artist.Name}" Style="{StaticResource SubtleTextBlockStyle}" />
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="AlbumNarrowTemplate" x:DataType="databaseModels:Album">
        <Grid Margin="0,4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Width="100" Height="100" Background="{ThemeResource SystemControlBackgroundAccentBrush}"
                  Margin="0,0,5,0">
                <Image Source="{x:Bind ArtworkUri, Converter={StaticResource ImageSourceConverter}}"
                       Stretch="UniformToFill" />
            </Grid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <TextBlock Text="{x:Bind Title}" TextWrapping="Wrap" Margin="0,0,0,5"
                           MaxHeight="80" LineHeight="20" LineStackingStrategy="BlockLineHeight" />
                <TextBlock Grid.Row="1" Text="{x:Bind Artist.Name}" Style="{StaticResource SubtleTextBlockStyle}" />
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ArtistTemplate" x:DataType="databaseModels:Artist">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Ellipse Width="140" Height="140" Fill="#333" />
            <Ellipse Grid.Row="0" Width="140" Height="140">
                <Ellipse.Fill>
                    <ImageBrush ImageSource="{x:Bind ArtworkUri, Converter={StaticResource ImageSourceConverter}}"
                                Stretch="UniformToFill" />
                </Ellipse.Fill>
            </Ellipse>
            <TextBlock Grid.Row="1" Text="{x:Bind Name}" TextAlignment="Center" Margin="0,10,0,0" />
            <TextBlock Grid.Row="2" TextAlignment="Center" Style="{StaticResource SubtleTextBlockStyle}">
                <Run Text="{x:Bind Albums.Count}" />
                <Run Text="album(s)" />
            </TextBlock>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ArtistNarrowTemplate" x:DataType="databaseModels:Artist">
        <Grid Margin="0,4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Margin="0,0,5,0">
                <Ellipse Width="100" Height="100" Fill="#333" />
                <Ellipse Grid.Row="0" Width="100" Height="100">
                    <Ellipse.Fill>
                        <ImageBrush ImageSource="{x:Bind ArtworkUri, Converter={StaticResource ImageSourceConverter}}"
                                    Stretch="UniformToFill" />
                    </Ellipse.Fill>
                </Ellipse>
            </Grid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <TextBlock Text="{x:Bind Name}" TextWrapping="Wrap" Margin="0,0,0,5"
                           MaxHeight="80" LineHeight="20" LineStackingStrategy="BlockLineHeight" />
                <TextBlock Grid.Row="1" Style="{StaticResource SubtleTextBlockStyle}">
                    <Run Text="{x:Bind Albums.Count}" /><commit_msg>Fix binding with artist template<commit_after>﻿<ResourceDictionary
    x:Class="Audiotica.Windows.DataTemplates.LibraryDictionary"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Audiotica.Windows.Controls"
    xmlns:databaseModels="using:Audiotica.Database.Models"
    xmlns:webModels="using:Audiotica.Web.Models">
    
    <DataTemplate x:Key="TrackTemplate" x:DataType="databaseModels:Track">
        <controls:TrackViewer Track="{x:Bind}"
                              IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>

    <DataTemplate x:Key="CatalogTrackTemplate" x:DataType="databaseModels:Track">
        <controls:TrackViewer Track="{x:Bind}"
                              IsCatalog="True"
                              IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>

    <DataTemplate x:Key="TrackNarrowTemplate" x:DataType="databaseModels:Track">
        <controls:TrackNarrowViewer Track="{x:Bind}"
                                    IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>
    <DataTemplate x:Key="CatalogTrackNarrowTemplate" x:DataType="databaseModels:Track">
        <controls:TrackNarrowViewer Track="{x:Bind}"
                                    IsCatalog="True"
                                    IsSelected="{Binding Tag, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    </DataTemplate>

    <DataTemplate x:Key="AlbumTemplate" x:DataType="databaseModels:Album">
        <StackPanel Width="140" Height="210" Margin="4">
            <Grid Width="140" Height="140" Background="{ThemeResource SystemControlBackgroundAccentBrush}"
                  Margin="0,0,0,5">
                <Image Source="{x:Bind ArtworkUri, Converter={StaticResource ImageSourceConverter}}"
                       Stretch="UniformToFill" />
            </Grid>
            <TextBlock Text="{x:Bind Title}" TextWrapping="Wrap" Margin="0,0,0,5"
                       MaxHeight="40" LineHeight="20" LineStackingStrategy="BlockLineHeight" />
            <TextBlock Text="{x:Bind Artist.Name}" Style="{StaticResource SubtleTextBlockStyle}" />
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="AlbumNarrowTemplate" x:DataType="databaseModels:Album">
        <Grid Margin="0,4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Width="100" Height="100" Background="{ThemeResource SystemControlBackgroundAccentBrush}"
                  Margin="0,0,5,0">
                <Image Source="{x:Bind ArtworkUri, Converter={StaticResource ImageSourceConverter}}"
                       Stretch="UniformToFill" />
            </Grid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <TextBlock Text="{x:Bind Title}" TextWrapping="Wrap" Margin="0,0,0,5"
                           MaxHeight="80" LineHeight="20" LineStackingStrategy="BlockLineHeight" />
                <TextBlock Grid.Row="1" Text="{x:Bind Artist.Name}" Style="{StaticResource SubtleTextBlockStyle}" />
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ArtistTemplate" x:DataType="databaseModels:Artist">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Ellipse Width="140" Height="140" Fill="#333" />
            <Ellipse Grid.Row="0" Width="140" Height="140">
                <Ellipse.Fill>
                    <ImageBrush ImageSource="{x:Bind ArtworkUri, Mode=OneWay, Converter={StaticResource ImageSourceConverter}}"
                                Stretch="UniformToFill" />
                </Ellipse.Fill>
            </Ellipse>
            <TextBlock Grid.Row="1" Text="{x:Bind Name}" TextAlignment="Center" Margin="0,10,0,0" />
            <TextBlock Grid.Row="2" TextAlignment="Center" Style="{StaticResource SubtleTextBlockStyle}">
                <Run Text="{x:Bind Albums.Count, Mode=OneWay}" />
                <Run Text="album(s)" />
            </TextBlock>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ArtistNarrowTemplate" x:DataType="databaseModels:Artist">
        <Grid Margin="0,4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Margin="0,0,5,0">
                <Ellipse Width="100" Height="100" Fill="#333" />
                <Ellipse Grid.Row="0" Width="100" Height="100">
                    <Ellipse.Fill>
                        <ImageBrush ImageSource="{x:Bind ArtworkUri, Converter={StaticResource ImageSourceConverter}}"
                                    Stretch="UniformToFill" />
                    </Ellipse.Fill>
                </Ellipse>
            </Grid>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <TextBlock Text="{x:Bind Name}" TextWrapping="Wrap" Margin="0,0,0,5"
                           MaxHeight="80" LineHeight="20" LineStackingStrategy="BlockLineHeight" />
                <TextBlock Grid.Row="1" Style="{StaticResource SubtleTextBlockStyle}">
                    <Run Text="{x:Bind Albums.Count}" />
{'fraction_non_alphanumeric': 0.13403550496899685, 'fraction_numerical': 0.018686825787819588, 'mean_word_length': 2.2284069097888675, 'pattern_counts': {'":': 0, '<': 169, '<?xml version=': 0, '>': 169, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6719193', 'n_tokens_mistral': 3401, 'n_tokens_neox': 3063, 'n_words': 476}