<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="EsriMapSamples.FlickerGeoRSS" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" 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:local="clr-namespace:EsriMapSamples" xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
    <UserControl.Resources>
        <local:ImageConverter x:Key="icnv" />
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Border>
            <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
                <TextBlock VerticalAlignment="Center" Text="Enter the place or location:" />
                <TextBox x:Name="tb" Text="USA/Ohio/Columbus" MinWidth="200" KeyDown="tb_KeyDown" Margin="10,0" />
                <Button x:Name="btnLoad" Content="Load" Width="80" Click="Button_Click" />
            </StackPanel>
        </Border>
        <esri:Map Background="White" Grid.Row="1" Name="map1" WrapAround="True">
            <esri:Map.Layers>
                <esri:LayerCollection>
                    <esri:ArcGISTiledMapServiceLayer Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" />
                    <esri:GeoRssLayer ID="GeoRSSLayer" Source="http://api.flickr.com/services/feeds/geo/USA/Ohio/Columbus">
                        <esri:GeoRssLayer.Renderer>
                            <esri:SimpleRenderer>
                                <esri:MarkerSymbol>
                                    <esri:MarkerSymbol.ControlTemplate>
                                        <ControlTemplate>
                                            <Border Background="#70ffffff" BorderBrush="BurlyWood" BorderThickness="1" CornerRadius="3">
                                                <Image MaxWidth="100" MaxHeight="100" Opacity="0.8" Source="{Binding Converter={StaticResource icnv}}" />
                                            </Border>
                                        </ControlTemplate>
                                    </esri:MarkerSymbol.ControlTemplate>
                                </esri:MarkerSymbol>
                            </esri:SimpleRenderer>
                        </esri:GeoRssLayer.Renderer>
                        <esri:GeoRssLayer.MapTip>
                            <Border Padding="5" Background="White" esri:GraphicsLayer.MapTipHideDelay="0:0:0.5">
                                <StackPanel>
                                    <TextBlock Text="{Binding [Title]}" FontWeight="Bold" FontSize="14" Foreground="Black" />
                                    <TextBlock Text="{Binding [PublishDate]}" FontSize="10" Foreground="Black" />
                                    <HyperlinkButton Content="Link" NavigateUri="{Binding [Link]}" Opacity=".5" FontSize="10" Foreground="Blue" TargetName="_blank" />
                                </StackPanel>
                            </Border>
                        </esri:GeoRssLayer.MapTip>
                    </esri:GeoRssLayer>
                </esri:LayerCollection>
            </esri:Map.Layers>
        </esri:Map>
    </Grid>
</UserControl>