private void ExecuteShowAddModalCommand(StudentListViewModel obj) { var dialog = ServiceLocator.Current.GetInstance <IStudentDialog>(); dialog.BindViewModel(new StudentViewModel()); dialog.ShowDialog(); }
private void ExecuteDeleteMany(StudentListViewModel studentListViewModel) { ServiceLocator.Current.GetInstance <IDialogService>() .ShowQuestion("Are you sure?", $"Delete {SelectedStudents.Count} Students", yes => { if (yes) { foreach (var selectedStudent in SelectedStudents) { _studentHelper.DeleteStudent(selectedStudent); } Messenger.Default.Send <NotificationMessage>(null, NotificationMessages.UpdateStudentList); } }); }
public MainViewModel() { _studentListViewModel = new StudentListViewModel(); ShowSettingsModal = new CommandBase <MainViewModel>("Settings", ExecuteShowSettingsModal); }