public AddNewSectorViewModel(AddNewSectorView addNewSector) { this.addNewSector = addNewSector; Name = string.Empty; Description = string.Empty; sector = new tblSector(); }
private void AddNewSectorExecute() { try { AddNewSectorView addNewSectorViewView = new AddNewSectorView(); addNewSectorViewView.ShowDialog(); if ((addNewSectorViewView.DataContext as AddNewSectorViewModel).IsAddedNewSector == true) { Sectors = LoadSectors(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }