<Page
    x:Class="DashboardUWP.Analysis"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:DashboardUWP"
    xmlns:chart="using:C1.Xaml.Chart"
    xmlns:map="using:C1.Xaml.Maps"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" Loaded="OnLoaded">
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ms-appx:///Style/Style.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Page.Resources>
    <Grid Background="#f7f7f7">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock x:Uid="AnalysisPageTitle" Style="{ThemeResource MobileTilte}" />
        <Pivot Margin="5" Grid.Row="1" Background="White">
            <PivotItem>
                <PivotItem.Header>
                    <TextBlock Style="{ThemeResource MobilePiovtHeaderStyle}" x:Uid="ProductWise"/>
                </PivotItem.Header>
                <Grid x:Name="ProductWiseRoot">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition Height="3*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="2*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.RowSpan="2" x:Name="ListBoxRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid x:Name="AddProduct" Grid.ColumnSpan="2">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <TextBlock Margin="5" FontSize="10" x:Uid="FilterByProduct"/>
                            <ListBox Grid.Row="1" Style="{ThemeResource MobileAnalysisViewStyle}" SelectionChanged="OnSelectionChanged" x:Name="ProductList"/>
                        </Grid>
                        <Grid x:Name="AddRegion" Grid.ColumnSpan="2" Grid.Row="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <TextBlock Margin="5" FontSize="10" x:Uid="FilterByRegion"/>
                            <ListBox Grid.Row="1" Style="{ThemeResource MobileAnalysisViewStyle}" SelectionChanged="OnSelectionChanged" x:Name="RegionList"/>
                        </Grid>
                    </Grid>
                    <chart:C1FlexPie Grid.RowSpan="2" Grid.Column="1" FontSize="10" x:Name="ProductWiseSales" Palette="Flatly" LegendPosition="Bottom" StartAngle="0" Binding="Sales" BindingName="Name" SelectedItemOffset="0.2" SelectionMode="Point"/>
                </Grid>
            </PivotItem>
            <PivotItem>
                <PivotItem.Header>
                    <TextBlock Style="{ThemeResource MobilePiovtHeaderStyle}" x:Uid="RegionWise"/>
                </PivotItem.Header>
                <map:C1Maps x:Name="Map" Grid.Row="1" Zoom="2" Margin="5" Center="-100,30"/>
            </PivotItem>
            <PivotItem>
                <PivotItem.Header>
                    <TextBlock Style="{ThemeResource MobilePiovtHeaderStyle}" x:Uid="MobileOpportunities"/>
                </PivotItem.Header>
                <Grid>
                    <chart:C1FlexChart x:Name="FunelChart" FontSize="10" BindingX="Level" RenderMode="Direct2D" LegendPosition="Bottom" ChartType="Funnel">
                        <chart:Series Binding="Sales" />
                        <chart:C1FlexChart.DataLabel>
                            <chart:DataLabel Content="{}{y:C0}" Position="Center" />
                        </chart:C1FlexChart.DataLabel>
                        <chart:C1FlexChart.Options>
                            <chart:ChartOptions FunnelType="Default" FunnelNeckHeight="0.2"/>
                        </chart:C1FlexChart.Options>
                    </chart:C1FlexChart>
                </Grid>
            </PivotItem>
        </Pivot>
    </Grid>
</Page>
