<Page
    x:Class="MapsSamples.Cities"
    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:loc="using:MapsSamples"
    xmlns:c1="using:C1.Xaml.Maps"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <UserControl.Resources>
        <!-- Converters -->
        <loc:LODConverter x:Key="lodCnv" />
        <loc:GeometryConverter x:Key="geomCnv" />

        <!-- Template -->
        <DataTemplate x:Key="templCity">
            <c1:C1VectorPlacemark Fill="Transparent" Loaded="C1VectorPlacemark_Loaded" GeoPoint="{Binding GeoPoint}" Label="{Binding Name}" LabelPosition="Right" Stroke="#80FFFFFF" StrokeThickness="2" Lod="{Binding Population,Converter={StaticResource lodCnv}}" Geometry="{Binding Population,Converter={StaticResource geomCnv}}">
            </c1:C1VectorPlacemark>
        </DataTemplate>

    </UserControl.Resources>        
    <Grid x:Name="LayoutRoot">
        <c1:C1Maps x:Name="maps" Zoom="2" />
        <loc:MapTool Maps="{Binding ElementName=maps}" x:Name="mapTool"></loc:MapTool>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0"></AdaptiveTrigger>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="mapTool.Visibility" Value="Collapsed"></Setter>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="540"></AdaptiveTrigger>
                    </VisualState.StateTriggers>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>
