<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:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:chart="using:C1.Xaml.Chart"
    xmlns:map="using:C1.Xaml.Maps"
    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 Style="{ThemeResource RootGrid}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="3*"/>
                <RowDefinition Height="2*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition Width="2*"/>
            </Grid.ColumnDefinitions>
            <TextBlock x:Uid="AnalysisPageTitle" Grid.ColumnSpan="2" Style="{ThemeResource Tilte}" />
            <Border Margin="0,10,5,0" Grid.Row="1" Grid.RowSpan="2" Style="{ThemeResource TileBorder}">
                <Grid x:Name="ProductWiseRoot">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="3*"/>
                    </Grid.RowDefinitions>
                    <TextBlock x:Uid="ProductWise" Style="{ThemeResource TilePanelTitleText}" Margin="5"/>
                    <Grid Grid.Row="1" x:Name="ListBoxRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <StackPanel x:Name="AddProduct">
                            <TextBlock Margin="5" x:Uid="FilterByProduct"/>
                            <ListBox Style="{ThemeResource AnalysisViewStyle}" SelectionChanged="OnSelectionChanged" x:Name="ProductList"/>
                        </StackPanel>
                        <StackPanel x:Name="AddRegion" Grid.Column="1">
                            <TextBlock Margin="5" x:Uid="FilterByRegion"/>
                            <ListBox Style="{ThemeResource AnalysisViewStyle}" SelectionChanged="OnSelectionChanged" x:Name="RegionList"/>
                        </StackPanel>
                    </Grid>
                    <chart:C1FlexPie Grid.Row="2" x:Name="ProductWiseSales" Palette="Flatly" LegendPosition="Right" StartAngle="0" Binding="Sales" BindingName="Name" SelectedItemOffset="0.2" SelectionMode="Point">
                        <chart:C1FlexPie.DataLabel>
                            <chart:PieDataLabel Content="{}{y:C0}" Position="Inside"/>
                        </chart:C1FlexPie.DataLabel>
                    </chart:C1FlexPie>
                </Grid>
            </Border>
            <Border Margin="5,10,0,5" Grid.Column="1" Grid.Row="1" Style="{ThemeResource TileBorder}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock x:Uid="RegionWise" Style="{ThemeResource TilePanelTitleText}" Margin="5"/>
                        <SymbolIcon Margin="5" Grid.Column="1" Symbol="FullScreen" HorizontalAlignment="Right" PointerPressed="OnPointerPressed" />
                    </Grid>
                    <map:C1Maps x:Name="Map" Grid.Row="1" Zoom="2" Margin="5" Center="-100,30"/>
                </Grid>
            </Border>
            <Border Margin="5,5,0,0" Grid.Row="2" Grid.Column="1" Style="{ThemeResource TileBorder}">
                <chart:C1FlexChart x:Name="FunelChart" x:Uid="Opportunities" Style="{ThemeResource TilePanelTitleChart}" BindingX="Level" 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.24" />
                    </chart:C1FlexChart.Options>
                </chart:C1FlexChart>
            </Border>
            <Grid Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" x:Name="ScaleMapPane" Visibility="Collapsed">
                <Border Style="{ThemeResource TileBorder}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <TextBlock x:Uid="RegionWise" Style="{ThemeResource TilePanelTitleText}" Margin="5"/>
                            <SymbolIcon Margin="5" Grid.Column="1" Symbol="Clear" HorizontalAlignment="Right" PointerPressed="OnPointerPressed" />
                        </Grid>
                        <map:C1Maps x:Name="ScaleMap" Grid.Row="1" Zoom="2" Margin="5" Center="-100,30"/>
                    </Grid>
                </Border>
            </Grid>
        </Grid>
    </Grid>
</Page>
