I was trying the following:
<esri:Map x:Name="m_internalControl" Background="White">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
<esri:GraphicsLayer ID="MyGraphics" >
<esri:GraphicsLayer.MapTip>
<Border BorderBrush="DarkGray" CornerRadius="13" BorderThickness="1" Margin="0,0,15,15">
<Border.Effect>
<DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />
</Border.Effect>
<Border CornerRadius="10" Background="#DDFFEEEE" BorderThickness="5" BorderBrush="#77FF0000">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="10">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Name: " FontWeight="Bold" Foreground="#FF0F274E" FontSize="10" VerticalAlignment="Center"/>
<TextBlock Text="{Binding [GraphicData].Name}" HorizontalAlignment="Left" VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</Border>
</Border>
</esri:GraphicsLayer.MapTip>
</esri:GraphicsLayer>
</esri:Map>
...
internal class GraphicData : INotifyPropertyChanged
{
private string _name = null;
public string Name
{
get { return _name; }
set
{
_name = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("Name"));
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
...
GraphicsLayer gLayer = m_internalControl.Layers["MyGraphics"] as GraphicsLayer;
Graphic g = new Graphic();
g.Symbol = this.Resources["RedMarkerSymbol"] as Symbol;
g.Geometry = new MapPoint(-140.9, 63.391);
g.Attributes["GraphicData"] = new GraphicData() { Name = "Graphic 1" };
gLayer.Graphics.Add(g);
With a WPF application, the MapTip appears as expected with "Name: Graphic 1". With Silverlight, the bound value is empty and the MapTip appears with "Name:". Is there a different notation needed for Silverlight? Is it a bug? I'm using API 2.1.Thanks,Ed