Esempio n. 1
0
 private void ExecuteDeleteWindowCommand(StudentViewModel studentViewModel)
 {
     ServiceLocator.Current.GetInstance <IDialogService>()
     .ShowQuestion("Are you sure?", $"Delete Student {FullName}",
                   yes =>
     {
         if (yes)
         {
             _studentHelper.DeleteStudent(this);
             Messenger.Default.Send <NotificationMessage>(null, NotificationMessages.UpdateStudentList);
         }
     });
 }
        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);
                }
            });
        }