<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="VectorLayer.Samples.Flicker" mc:Ignorable="d" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:local="clr-namespace:VectorLayer.Samples" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
  <UserControl.Resources>
    <c1:XElementConverter x:Key="xcnv" />
    <local:ImageConverter x:Key="icnv" />
    <Style x:Key="style" TargetType="c1:C1VectorPlacemark">
      <Setter Property="Stroke" Value="#FF8FB4CC" />
      <Setter Property="StrokeThickness" Value="2" />
      <Setter Property="LabelTemplate">
        <Setter.Value>
          <DataTemplate>
            <Border MouseLeftButtonDown="Border_MouseLeftButtonDown" Background="#70ffffff" BorderBrush="BurlyWood" BorderThickness="1" CornerRadius="3">
              <StackPanel Orientation="Vertical">
                <TextBlock x:Name="txt" Visibility="Collapsed" FontSize="8" MaxWidth="100" TextWrapping="Wrap" Text="{Binding Converter={StaticResource xcnv}, ConverterParameter=title}" />
                <Image x:Name="img" MaxWidth="50" MaxHeight="50" Opacity="0.8" Source="{Binding Converter={StaticResource icnv}}" />
              </StackPanel>
            </Border>
          </DataTemplate>
        </Setter.Value>
      </Setter>
      <Setter Property="Geometry" Value="M3,0 A 3,3 180 1 0 -3,0 A 3,3 180 1 0 3,0 Z" />
    </Style>

  </UserControl.Resources>
  <Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition />
    </Grid.RowDefinitions>
        <Border Grid.Row="1">
            <c1:C1Maps x:Name="maps" Opacity="0.5">
                <c1:C1VectorLayer x:Name="vl" LabelVisibility="Visible" ItemStyle="{StaticResource style}" UriSourceLoaded="vl_UriSourceLoaded" UriSource="http://api.flickr.com/services/feeds/geo/Uruguay/Montevideo" />
            </c1:C1Maps>
        </Border>
        <TextBlock x:Name="txt" FontSize="24" HorizontalAlignment="Center" VerticalAlignment="Center" Text="Loading data..." Grid.Row="1" />

    <Border>
		<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
	      <TextBlock VerticalAlignment="Center" Text="Enter the place or location:" />
	      <TextBox x:Name="tb" IsEnabled="False" Text="Uruguay/Montevideo" MinWidth="200" KeyDown="tb_KeyDown" Margin="10,0" />
	      <Button x:Name="btnLoad" IsEnabled="False" Content="Load" Width="80" Click="Button_Click" />
	    </StackPanel>
	</Border>
  </Grid>
</UserControl>