Thanks to both for your responses. I did review and tried the code before, but not successful. In my scenario, the tooltip is applied to a usercontrol tool. In the usercontrol's xaml,
<esri:Map x:Name="_Map" Background="White" Extent="-122.554, 37.615, -122.245, 37.884" >
<esri:GraphicsLayer ID="MyGraphicsLayer">
</esri:Map>
...
<Canvas HorizontalAlignment="Left" VerticalAlignment="Top" >
<esri:MapTip x:Name="MyMapTip" BorderBrush="#99000000"
BorderThickness="1" Title="State Info" VerticalOffset="10"
HorizontalOffset="10" Background="#DDFFFFFF" />
</Canvas>
In the C# file,
GraphicsLayer graphicsLayer = _Map.Layers["MyGraphicsLayer"] as GraphicsLayer;
MyMapTip.GraphicsLayer = graphicsLayer;
Also the usercontrol's _Map is set the same as the MainPage's MyMap
in MainPage.xaml.cs:
myUserControl.SetMap(this.MyMap);
in the C# file, by:
public void SetMap(Map TheMap); {
_Map = TheMap;
}
Is there anything wrong in my coding? Thanks.