<Page
    x:Class="BoxOfficeDashboard.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BoxOfficeDashboard"
    xmlns:vm="using:BoxOfficeDashboard.ViewModels"
    xmlns:v="using:BoxOfficeDashboard.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Page.DataContext>
        <vm:ViewModel />
    </Page.DataContext>
    <Grid>
        <Pivot  ItemsSource="{Binding StudiosByYear}" >
            <Pivot.Title>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Studio Market Share" />
                    <TextBlock Text="Powered by" Margin="10 0 5 0" FontSize="12" VerticalAlignment="Bottom" />
                    <TextBlock Text="BoxOffice"  FontFamily="Impact" FontSize="12" VerticalAlignment="Bottom"/>
                    <TextBlock Text="Mojo"  FontFamily="Impact" Margin="1 0" Foreground="#FFAE0000" FontSize="12" VerticalAlignment="Bottom"/>
                    <TextBlock Text=".com"  FontFamily="Impact" FontSize="12" VerticalAlignment="Bottom"/>
                </StackPanel>
            </Pivot.Title>
            <Pivot.HeaderTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding [0].Year}" FontSize="32"/>
                </DataTemplate>
            </Pivot.HeaderTemplate>
            <Pivot.ItemTemplate>
                <DataTemplate>
                    <Grid Background="#5D5D5D" Margin="0 -20 0 0">
                        <v:DashboardView />
                    </Grid>
                </DataTemplate>
            </Pivot.ItemTemplate>
        </Pivot>
    </Grid>
</Page>