private void NewBtn_Click(object sender, RoutedEventArgs e) { AddEditViewModel addEditViewModel = new AddEditViewModel(); AddEditUser frm = new AddEditUser(addEditViewModel); frm.ShowDialog(); if (frm.DialogResult == true) { var newUser = addEditViewModel.CurrentUser; mainViewModel.UserList.Add(newUser); mainViewModel.CurrentUser = newUser; } }
public void editBtn_Click(object sender, RoutedEventArgs e) { var user = mainViewModel.CurrentUser; AddEditViewModel addEditViewModel = new AddEditViewModel(user); AddEditUser frm = new AddEditUser(addEditViewModel); frm.ShowDialog(); if (frm.DialogResult == true) { } }