InfoWindow

This sample demonstrates the InfoWindow control. The InfoWindow control allows displaying content placed at a specific anchor point on the Map control. The Content property of an InfoWindow can be any type of object, such as a string, a UIElement, or a DateTime. For this sample, if the user clicks over a US State the name of the State will appear in the InfoWindow. The sample shows how to add Content to an existing InfoWindow defined in XAML using code-behind and how to create a new InfoWindow wholly in code-behind and populate its Content.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalInfoWindowSimple"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <esri:SimpleRenderer x:Key="MySimpleRenderer">
                <esri:SimpleRenderer.Symbol>
                    <esri:SimpleFillSymbol Fill="#01FFFFFF" BorderBrush="#88000000" BorderThickness="2" />
                </esri:SimpleRenderer.Symbol>
            </esri:SimpleRenderer>
            <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0">
                <LinearGradientBrush.RelativeTransform>
                    <TransformGroup>
                        <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                        <SkewTransform CenterY="0.5" CenterX="0.5"/>
                        <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </LinearGradientBrush.RelativeTransform>
                <GradientStop Color="#FF145787" Offset="0.16"/>
                <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                <GradientStop Color="#FF88C5EF" Offset="0.984"/>
            </LinearGradientBrush>
            <DataTemplate x:Key="MyFeatureLayerInfoWindowTemplate">
                <TextBlock Text="{Binding [STATE_NAME]}" Foreground="White" FontSize="12" />
            </DataTemplate>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" Extent="-15000000,2000000,-7000000,8000000" WrapAround="True" MouseClick="MyMap_MouseClick" MinimumResolution="2445.98490512499">
            <esri:ArcGISLocalTiledLayer ID="myBaseMap" Path="..\\Data\\TPKs\\Topographic.tpk"/>
            <esri:ArcGISLocalFeatureLayer ID="MyFeatureLayer" LayerName="States" Path="..\\Data\\MPKS\\USCitiesStates.mpk" 
                            Renderer="{StaticResource MySimpleRenderer}"     OutFields="STATE_NAME,POP2000"/>
        </esri:Map>
        <esri:InfoWindow x:Name="MyInfoWindow"
                         Padding="2"
                         CornerRadius="20"                          
                         Background="{StaticResource PanelGradient}"
                         Map="{Binding ElementName=MyMap}" 
                         ContentTemplate="{StaticResource MyFeatureLayerInfoWindowTemplate}"
                         MouseLeftButtonUp="MyInfoWindow_MouseLeftButtonUp" />
        <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
    </Grid>
</UserControl>
Sample code usage restrictions
5/16/2014