<Page
    x:Class="FlexChartPrint.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:FlexChartPrint"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml.Chart"
    mc:Ignorable="d">
    <Page.Resources>
        <Style TargetType="Button">
            <Setter Property="Margin" Value="4"/>
            <Setter Property="Width" Value="140"/>
        </Style>
    </Page.Resources>

    <Grid x:Name="root" Loaded="root_Loaded" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.DataContext>
            <local:Strings />
        </Grid.DataContext>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto"/>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>


        <Border BorderBrush="LightGray" BorderThickness="1" Grid.ColumnSpan="2">
            <StackPanel Orientation="Horizontal" Margin="10">
                <Image Source="ms-appx:///Resources/C1.png" Width="80" Height="80"/>
                <Grid Margin="20 0">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding Title}" FontWeight="Bold" FontSize="25" VerticalAlignment="Bottom" />
                    <TextBlock Text="{Binding  Description}" TextWrapping="Wrap" Grid.Row="1" Style="{ThemeResource CaptionTextBlockStyle}"/>
                </Grid>
            </StackPanel>
        </Border>

        <VariableSizedWrapGrid x:Name="pnlOptions" Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="1">
            <Button x:Name="btnPrintSingle" Content="Print all charts&#x0a;on single page" Click="btnPrintSingle_Click" />
            <Button x:Name="btnPrintMulti" Content="Print charts&#x0a;on separate pages" Click="btnPrintMulti_Click" />
            <Button x:Name="btnPrintMultiLine" Content="Print line chart&#x0a;on multiple pages" Click="btnPrintMultiLine_Click" />
        </VariableSizedWrapGrid>

        <c1:C1FlexChart x:Name="lineChart" Grid.Row="2" Grid.ColumnSpan="2"></c1:C1FlexChart>
        <c1:C1FlexChart x:Name="columnChart" Grid.Row="3"></c1:C1FlexChart>
        <c1:C1FlexPie x:Name="pieChart" Grid.Row="3" Grid.Column="1" />
    </Grid>

</Page>
