private void AddLayer(string filename) { LayerData layerData; try { layerData = _layerController.OpenLayer(filename); } catch (Exception e) { MessageBox.Show($"Shape file:\"{filename}\" can`t be read. {e.Message}"); return; } AddItemToListBox(layerData.Name); MyMapView.Map.Layers.Add(layerData.Layer); }