private void AddContact() { var result = EditWindowController.ShowDialog(new OpenEditWindowArgs { Type = ActionType.Add }); if (result.HasValue && result.Value) { AllContacts = new ObservableCollection <Contact>(DataProvider.GetAllContacts().OfType <Contact>()); } }
private void EditPersonal(Personal personal) { var result = EditWindowController.ShowDialog(new OpenEditWindowArgs { Type = ActionType.Edit, Personal = SelectedPersonal }); if (result.HasValue && result.Value) { int index = AllPersonals.IndexOf(SelectedPersonal); AllPersonals = new ObservableCollection <Personal>(DataProvider.GetAllPersonal().OfType <Personal>()); SelectedPersonal = AllPersonals[index]; DialogService.ShowMessage("Angestellten erfolgreich bearbeitet"); } }
private void EditContact(Contact contact) { var result = EditWindowController.ShowDialog(new OpenEditWindowArgs { Type = ActionType.Edit, Contact = SelectedContact }); if (result.HasValue && result.Value) { //remember the users selection int index = AllContacts.IndexOf(SelectedContact); AllContacts = new ObservableCollection <Contact>(DataProvider.GetAllContacts().OfType <Contact>()); //re-selected the original item SelectedContact = AllContacts[index]; } }
private void EditFriend(Friend friend) { var result = EditWindowController.ShowDialog(new OpenEditWindowArgs { Type = ActionType.Edit, Friend = SelectedFriend }); if (result.HasValue && result.Value) { // Remember user's selection int index = AllFriends.IndexOf(SelectedFriend); AllFriends = new ObservableCollection <Friend>(DataProvider.GetAllFriends().OfType <Friend>()); // re-selected the original item SelectedFriend = AllFriends[index]; } }