Solved! Go to Solution.
void MyMap_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Delete) { var l = MyMap.Layers["Drawing Layer"] as GraphicsLayer; if (l != null) { var graphic = l.Graphics.LastOrDefault(g => g.Geometry != null); if (graphic != null) l.Graphics.Remove(graphic); //check if this returns true/false. } } }
void MyMap_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Delete) { var l = MyMap.Layers["Drawing Layer"] as GraphicsLayer; if (l != null) { var graphic = l.Graphics.LastOrDefault(g => g.Geometry != null); if (graphic != null) l.Graphics.Remove(graphic); //check if this returns true/false. } } }