private void ClearAll() { //delete currently drawing polygon CurrentlyDrawingPolygon?.DeleteDrawing(); if (CurrentlyDrawingPolygon != null) { CurrentLine?.DeleteDrawing(); } CurrentLine = null; CurrentlyDrawingPolygon = null; PolygonDrawing = false; //delete polygons foreach (var pol in Polygons) { pol.Value.DeleteDrawing(); } //clear RelationIcon RelationIcon.RelationCounter.Clear(); //clear variables ClearVariables(); //set pointerbutton PointerButton.IsChecked = true; }
private bool ClearUnfinishedPolygon() { if (CurrentlyDrawingPolygon != null) { MessageBoxResult ans = MessageBox.Show("If you change mode during drawing,\n" + "currently drawn polygon will be deleted!\n" + "Do you want to continue drawing?", Globals.WindowName, MessageBoxButton.YesNo, MessageBoxImage.Question); if (ans == MessageBoxResult.Yes) { return(false); } else { CurrentlyDrawingPolygon.DeleteDrawing(); CurrentLine?.DeleteDrawing(); CurrentLine = null; CurrentlyDrawingPolygon = null; PolygonDrawing = false; } } return(true); }