private void FindDetails_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Highlight the graphic feature associated with the selected row DataGrid dataGrid = sender as DataGrid; GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; graphicsLayer.ClearGraphics(); int selectedIndex = dataGrid.SelectedIndex; if (selectedIndex >= 0) { FindResult findResult = (FindResult)FindDetailsDataGrid.SelectedItem; Graphic graphic = findResult.Feature; { graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as FillSymbol; graphicsLayer.Graphics.Insert(0, graphic); } graphicsLayer.Graphics.Add(graphic); } }
Graphic graphic = findResult.Feature; { graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as FillSymbol; graphicsLayer.Graphics.Insert(0, graphic); } graphicsLayer.Graphics.Add(graphic);