<Page RequestedTheme="Light"
    x:Class="StockPortfolio.HomePage" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:StockPortfolio"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  
    xmlns:c1tile="using:C1.Xaml.Tile"
   
    xmlns:data="using:StockPortfolio.Data"
    mc:Ignorable="d">
    

    <Page.Resources>
        <!--<Style TargetType="TextBlock">
            <Setter Property="Foreground" Value="#FF5D5D5D"/>
        </Style>-->
        <local:TileTemplateSelector x:Key="TileContentSelector"/>
        <local:TileItemContainerStyleSelector x:Key="TileItemContainerStyleSelector"/>
        <Storyboard x:Name="SelectionTransition">
            <DoubleAnimation BeginTime="0:0:0.2" Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
        </Storyboard>
        <Storyboard x:Name="LoadTransition">
            <DoubleAnimation Duration="0:0:0.1" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pivot" d:IsOptimized="True"/>
        </Storyboard>
    </Page.Resources>
    
    <Grid Background="White">
        <!--<local:PageBackgroundControl  />-->
        <Grid.RowDefinitions>
            <RowDefinition Height="56"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <local:HeaderPage />
        <Border Background="#FFEDEDED" Grid.Row="1" Height="40" VerticalAlignment="Top"/>
        <Pivot x:Name="pivot" Grid.Row="1" Margin="0 -10 0 0">
            <PivotItem>
                <PivotItem.Header>
                    <TextBlock Margin="0,10,0,0" Text="Function group" FontWeight="Bold" FontSize="20"/>
                </PivotItem.Header>

                <GridView ItemsSource="{Binding Groups}" Name="gridView" ItemContainerStyleSelector="{StaticResource TileItemContainerStyleSelector}"
                          IsItemClickEnabled="True"     ItemClick="gridView_ItemClick"    ItemTemplateSelector="{StaticResource TileContentSelector}"
                                SelectionMode="None" >
                    <GridView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VariableSizedWrapGrid Orientation="Horizontal" MaximumRowsOrColumns="2"  ItemHeight="180" ItemWidth="180"/>
                        </ItemsPanelTemplate>
                    </GridView.ItemsPanel>

                </GridView>

            </PivotItem>
            <PivotItem>
                <PivotItem.Header>
                    <TextBlock Margin="0,10,0,0" Text="About" FontSize="20" FontWeight="Bold" />
                </PivotItem.Header>
                <local:AboutPage HeaderVisbility="Collapsed"/>
            </PivotItem>
        </Pivot>


    </Grid>

    
</Page>