private void TextBlock_MouseEnter(object sender, MouseEventArgs e) { QueryResultData HiLight = (QueryResultData)(sender as FrameworkElement).DataContext; Graphic g = getGraphic(HiLight); g.Symbol = SearchSelectedSymbol; if (g != null) { g.Select(); g.SetZIndex(1); } } private void TextBlock_MouseLeave(object sender, MouseEventArgs e) { QueryResultData HiLight = (QueryResultData)(sender as FrameworkElement).DataContext; Graphic g = getGraphic(HiLight); g.Symbol = SearchPictureSymbol; if (g != null) { g.Select(); g.SetZIndex(0); } } private Graphic getGraphic(QueryResultData HiLight) { GraphicsLayer layer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer; if (HiLight != null && layer != null) { foreach (Graphic g in layer.Graphics) { if (g.Geometry == HiLight.SHAPE) { return g; } } } return null; }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.