Hello i am adding Graphics on my map.And adding tooltip on it.Tooltip is dispaying properly when the graphic type is PictureMarkerSymbol.But for polygon tooltip is giving me the errr like as followsCan anybdy help me to solve this?Unable to cast object of type 'ESRI.ArcGIS.Client.Geometry.Polygon' to type 'ESRI.ArcGIS.Client.Geometry.MapPoint'.
Private Sub MyDrawObject_DrawComplete(ByVal sender As Object, ByVal args As ESRI.ArcGIS.Client.DrawEventArgs) Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayer"), GraphicsLayer) Dim graphic As New ESRI.ArcGIS.Client.Graphic() With { .Geometry = args.Geometry, .Symbol = _activeSymbol } Dim strhotspot As String = "" strhotspot = Trim(TxtGname.Text) graphic.Attributes.Add("STRHOTSPOT", strhotspot) AddHandler graphic.MouseLeave, AddressOf Graphic_MouseLeave AddHandler graphic.MouseEnter, AddressOf Graphic_MouseEnter graphicsLayer.Graphics.Add(graphic) MyDrawObject.DrawMode = DrawMode.None TxtGname.Text = "" TxtDesc.Text = "" End Sub Private Sub Graphic_MouseLeave(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseEventArgs) If MyInfoWindow.IsOpen = True Then MyInfoWindow.IsOpen = False End If Return End Sub Private Sub Graphic_MouseEnter(ByVal sender As System.Object, ByVal e As System.Windows.Input.MouseEventArgs) Dim theGraphic As ESRI.ArcGIS.Client.Graphic = CType(sender, ESRI.ArcGIS.Client.Graphic) MyInfoWindow.Anchor = theGraphic.Geometry MyInfoWindow.IsOpen = True MyInfoWindow.Content = theGraphic.Attributes End Sub