<Page
    x:Class="FoxTube.Pages.Subscriptions"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <ScrollViewer>
        <controls:AdaptiveGridView ItemsSource="{x:Bind list}" DesiredWidth="250">
            <controls:AdaptiveGridView.ItemTemplate>
                <DataTemplate>
                    <Button HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Padding="5" Tag="{Binding Path=Snippet.ResourceId.ChannelId}" Click="Button_Click">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="55"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <PersonPicture Height="50" HorizontalAlignment="Left">
                                <PersonPicture.ProfilePicture>
                                    <BitmapImage UriSource="{Binding Path=Snippet.Thumbnails.Medium.Url}" DecodePixelHeight="50" DecodePixelWidth="50"/>
                                </PersonPicture.ProfilePicture>
                            </PersonPicture>
                            <TextBlock Grid.Column="1" TextWrapping="Wrap" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" Text="{Binding Path=Snippet.Title}"/>
                        </Grid>
                    </Button>
                </DataTemplate>
            </controls:AdaptiveGridView.ItemTemplate>
        </controls:AdaptiveGridView>
    </ScrollViewer>
</Page>
