private void FindDetails_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// Highlight the graphic feature associated with the selected row
ListBox dataGrid = sender as ListBox;
int selectedIndex = dataGrid.SelectedIndex;
if (selectedIndex > -1)
{
FindResult findResult = (FindResult)DataListBox.SelectedItem;
Graphic graphic = findResult.Feature;
switch (graphic.Attributes["Shape"].ToString())
{
case "Polygon":
graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Polyline":
graphic.Symbol = LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Point":
graphic.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
}
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.ClearGraphics();
graphicsLayer.Graphics.Add(graphic);
}
}