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

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <Pivot SelectionChanged="Pivot_SelectionChanged">
            <PivotItem x:Uid="/Playlist/appHistory" Header="Application">
                <Grid>
                    <ScrollViewer>
                        <StackPanel>
                            <Grid Margin="0,10" BorderBrush="Red" BorderThickness="5" CornerRadius="10" Padding="10">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <FontIcon Glyph="&#xF6FA;" FontSize="50" VerticalAlignment="Center"/>

                                <StackPanel Grid.Column="1" Margin="10,0">
                                    <TextBlock x:Uid="/Playlist/hlHeader" FontWeight="Bold" FontSize="25" Text="Missing some stuff?" VerticalAlignment="Center"/>
                                    <TextBlock x:Uid="/Playlist/hlBody" Text="Unfortunately, for now we are unable to manage your youtube history. If you want to see your web history go to 'Website' tab" TextWrapping="WrapWholeWords"/>
                                </StackPanel>
                            </Grid>
                            <Button Margin="5" x:Uid="/Playlist/clear" FontFamily="Segoe UI, Segoe MDL2 Assets" Content="&#xE107; Clear history" Name="clear" Click="Clear_Click"/>
                            <local:VideoGrid x:Name="list"/>
                            <controls:ShowMore x:Name="more" Clicked="ShowMore_Clicked"/>
                        </StackPanel>
                    </ScrollViewer>

                    <foxtube:LoadingPage x:Name="loading" Visibility="Collapsed" RefreshPage="Refresh_Click"/>
                </Grid>
            </PivotItem>
            <PivotItem x:Uid="/Playlist/webHistory" Header="Website">
                <Grid>
                    <ScrollViewer>
                        <StackPanel>
                            <local:VideoGrid x:Name="websiteList"/>
                            <controls:ShowMore x:Name="websiteMore" Clicked="WebsiteMore_Clicked"/>
                        </StackPanel>
                    </ScrollViewer>

                    <foxtube:LoadingPage x:Name="websiteLoading" Visibility="Collapsed" RefreshPage="Refresh_Click"/>
                </Grid>
            </PivotItem>
        </Pivot>

        <classes:AdaptiveCommandBar Grid.Row="1" DefaultLabelPosition="Right">
            <AppBarButton x:Uid="/Playlist/refresh" Icon="Refresh" Label="Refresh" Name="refresh" Click="Refresh_Click"/>
            <AppBarButton x:Uid="/Playlist/openWeb" Label="Open in browser" Icon="Globe" Name="toBrowser" Click="toBrowser_Click"/>
        </classes:AdaptiveCommandBar>
    </Grid>
</Page>
