public void CloseFeatureLayer() { if (SelectedLayer != null && SelectedLayer.IsOpen) { lock (SelectedLayer) SelectedLayer.Close(); } }