<UserControl x:Class="Shapes.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <UserControl.Resources>
        <m:ApplicationIdCredentialsProvider x:Key="BingStorageCred" ApplicationId="your way" />
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button x:Name="btnCreatePolygon" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" Tag="false"
                Click="btnCreatePolygon_Click">
            <TextBlock x:Name="txtButton">Add New Polygon</TextBlock>
        </Button>
        <TextBlock x:Name="txtDescription" Visibility="Collapsed" Margin="50,0,0,0">
                Click on the map to create the polygon points, then click Create.</TextBlock>
        <m:Map x:Name="MapWithPolygon" CredentialsProvider="{StaticResource BingStorageCred}" Mode="Road" Grid.Column="0" Grid.Row="1">
            <m:MapLayer x:Name="NewPolygonLayer">
            </m:MapLayer>
        </m:Map>
    </Grid>

</UserControl>
