MapTips Online

This sample demonstrates enabling MapTips on a GraphicsLayer using the GraphicsLayer's MapTip property. The sample XAML shows that the MapTip property can contain any valid XAML elements. Also shown is how attributes can be bound to text using a DictionaryConverter.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.MapTip"
    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>
            <esri:SimpleFillSymbol x:Key="DefaultFillSymbol"  Fill="#01FFFFFF" BorderBrush="#88000000" BorderThickness="2" />
            <esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol" Color="Red" Size="6" Style="Circle" />
            <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>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" Extent="-15000000,2000000,-7000000,8000000" WrapAround="True">
            <esri:ArcGISTiledMapServiceLayer ID="BaseMapLayer"
                        Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
            <esri:GraphicsLayer ID="StatesGraphicsLayer">
                <esri:GraphicsLayer.MapTip>
                    <Border esri:GraphicsLayer.MapTipHideDelay="00:00:01.5" CornerRadius="10" BorderBrush="Black" Margin="0,0,15,15" BorderThickness="2" Background="{StaticResource PanelGradient}">
                        <StackPanel Orientation="Vertical" Margin="18,15,18,15">
                            <StackPanel Orientation="Horizontal" Margin="0,0,0,2">
                                <TextBlock Text="State Name: " FontWeight="Bold" Foreground="White" />
                                <TextBlock Text="{Binding [STATE_NAME]}" Foreground="White"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Population 2007: " FontWeight="Bold" Foreground="White" />
                                <TextBlock Text="{Binding [POP2007]}" Foreground="White"/>
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </esri:GraphicsLayer.MapTip>
            </esri:GraphicsLayer>
            <esri:GraphicsLayer ID="CitiesGraphicsLayer" Initialized="CitiesGraphicsLayer_Initialized">
                <esri:GraphicsLayer.MapTip>
                    <Border BorderBrush="Black" CornerRadius="10" BorderThickness="2" Margin="0,0,15,15" Background="{StaticResource PanelGradient}">
                        <StackPanel Orientation="Vertical" Margin="18,15,18,15">
                            <StackPanel Orientation="Horizontal" Margin="0,0,0,2">
                                <TextBlock Text="City Name: " FontWeight="Bold" Foreground="White"/>
                                <TextBlock Text="{Binding [CITY_NAME]}" Foreground="White" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Population: " FontWeight="Bold" Foreground="White" />
                                <TextBlock Text="{Binding [POP1990]}" Foreground="White" />
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </esri:GraphicsLayer.MapTip>
            </esri:GraphicsLayer>
        </esri:Map>
        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10">
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="WhiteSmoke" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,10" />
            <TextBlock Text="Hover over a state or city to see the GraphicsLayer MapTip." TextAlignment="Center" Margin="25,25,25,25" Foreground="Black" />
        </Grid>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014