<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FlexGridSamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml"
    xmlns:FlexGrid="using:C1.Xaml.FlexGrid"
    x:Class="FlexGridSamples.YouTube"
    mc:Ignorable="d"
    d:DesignHeight="348"
    d:DesignWidth="908">
    <Grid>
        <StackPanel x:Name="loading" VerticalAlignment="Center">
            <TextBlock Text="Retrieving data from YouTube..." TextAlignment="Center"/>
            <c1:C1ProgressBar IsIndeterminate="True" IndeterminateForeground="#FF2C383D" Height="4"/>
        </StackPanel>
        <Button x:Name="retry" HorizontalAlignment="Center" VerticalAlignment="Center" Content="Retry" Visibility="Collapsed" Click="Retry_Click" />

        <FlexGrid:C1FlexGrid x:Name="flexgrid" IsReadOnly="True" Margin="10" GridLinesVisibility="None" ColumnHeaderBackground="{ThemeResource ApplicationPageBackgroundThemeBrush}" HeaderGridLinesBrush="{ThemeResource ApplicationPageBackgroundThemeBrush}" HeadersVisibility="Column" AutoGenerateColumns="False" SelectionMode="ListBox" Visibility="Collapsed">
            <FlexGrid:C1FlexGrid.Columns>
                <FlexGrid:Column Width="60">
                    <FlexGrid:Column.CellTemplate>
                        <DataTemplate>
                            <Image Source="{Binding Thumbnail}"/>
                        </DataTemplate>
                    </FlexGrid:Column.CellTemplate>
                </FlexGrid:Column>
                <FlexGrid:Column Binding="{Binding Title}" Header="Title" MinWidth="400" Width="*"/>
                <FlexGrid:Column Binding="{Binding Duration}" Header="Duration" Width="115"/>
                <FlexGrid:Column Header="Rating" Binding="{Binding Rating}" Width="115"/>
                <FlexGrid:Column Header="Views" Binding="{Binding ViewCount}"/>
                <FlexGrid:Column Header="Author" Binding="{Binding Author}" MinWidth="150"/>
                <FlexGrid:Column>
                    <FlexGrid:Column.CellTemplate>
                        <DataTemplate>
                            <HyperlinkButton Content="Watch" NavigateUri="{Binding Link}"/>
                        </DataTemplate>
                    </FlexGrid:Column.CellTemplate>
                </FlexGrid:Column>
            </FlexGrid:C1FlexGrid.Columns>
        </FlexGrid:C1FlexGrid>

    </Grid>
</UserControl>
