<Page
    x:Class="SalesDashboard.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SalesDashboard"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:data="using:SalesDashboard.Data"
    mc:Ignorable="d" Loaded="Page_Loaded_1">
    <Page.Resources>
        <data:SampleDataSource x:Key="sampleDataSource" />
    </Page.Resources>
    <Page.DataContext>
        <Binding Source="{StaticResource sampleDataSource}" />
    </Page.DataContext>

    <Grid>
        <Image x:Name="bgImage" Source="Assets/wood_bg.png" Stretch="Fill">
            <Image.RenderTransform>
                <RotateTransform x:Name="transform" Angle="0" />
            </Image.RenderTransform>
        </Image>
        
          <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="140"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid Margin="120 0 0 0">
                <TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" IsHitTestVisible="false" Style="{StaticResource PageHeaderTextStyle}" />
            </Grid>
            <FlipView Grid.Row="1">
                <FlipViewItem>
                    <Grid x:Name="grid1" Margin="120 0 40 46">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>

                        <local:QuarterlySales Margin="0" Padding="5" />
                        <local:TotalSales Grid.Row="1" Margin="0 20 0 0" Padding="5"/>

                        <local:SalesByType x:Name="salesByType" Grid.Column="1" Grid.RowSpan="2" Margin="20 0 0 0" Padding="5"/>
                    </Grid>
                </FlipViewItem>
                <FlipViewItem>
                    <Grid x:Name="grid2" Margin="120 0 40 46">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>

                        <local:SalesByRegion Margin="0" Padding="5" />
                        <local:SalesByPartner Grid.Row="1" Margin="0 20 0 0" Padding="5"/>
                        <local:SalesByCategory x:Name="salesByCategory" Grid.Column="1" Grid.RowSpan="2" Margin="20 0 0 0" Padding="5"/>
                    </Grid>
                </FlipViewItem>
            </FlipView>

        </Grid>
    </Grid>
</Page>
