private void DrawLine(object parameter) { readytodrawPoint = false; readytodrawLine = !readytodrawLine; readytodrawPolygon = false; Linepointcollec.Clear(); if (pointWin != null) { if (pointWin.IsVisible) { pointwinshowing = false; pointWin.Close(); } } if (PolygonWin != null) { if (PolygonWin.IsVisible) { PolygonWin.Close(); Polygonwinshowing = false; } } }