<Page
    x:Class="MapsSamples.MapChart"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MapsSamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml.Maps"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Border Margin="0 0 0 10" Grid.ColumnSpan="2">
            <TextBlock Text="Gross Domain Product(Purchasing Power Parity)" TextAlignment="Left" VerticalAlignment="Center" />
        </Border>
        <Border Grid.Row="1">
            <Grid>
                <c1:C1Maps x:Name="maps" Zoom="1"/>
                <StackPanel x:Name="legendPanel" VerticalAlignment="Bottom" Visibility="Collapsed">
                    <Grid Background="White" Opacity="0.2"  />
                    <ListBox x:Name="legend"                     
                    BorderThickness="0" 
                    Padding="4" 
                    FontSize="20" 
                    VerticalAlignment="Stretch"
                    DoubleTapped="legend_DoubleTapped">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Border CornerRadius="2" Width="10" Height="10" Margin="2 2 10 2" Background="{Binding Brush}"/>
                                    <TextBlock Text="{Binding Text}" FontSize="14"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <TextBlock Text="Values expressed in US$ million" TextAlignment="Left" FontSize="18" Margin="4"/>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
    <Page.BottomAppBar>
        <AppBar>
            <Grid>
                <StackPanel HorizontalAlignment="Left">
                    <AppBarButton Label="legend" Icon="Help" Click="btnLegend_Click"></AppBarButton>
                </StackPanel>
                <StackPanel HorizontalAlignment="Right">
                    <AppBarButton Label="legend" Click="btnZoomOrigin_Click">
                        <AppBarButton.Icon>
                            <BitmapIcon UriSource="ms-appx:///MapsSamplesLib2015/Resources/zoom_1-1.png"></BitmapIcon>
                        </AppBarButton.Icon>
                    </AppBarButton>
                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>
</Page>
