private async void Button_Click(object sender, RoutedEventArgs e) { if (lstView_main.SelectedIndex == -1) { return; } foreach (Objects.InstructorSalaryListViewItem item in lstView_main.SelectedItems) { if (await this.ShowMessageAsync("Payment", "You're going to pay " + item.Salary + " to " + Globals.Instructors[item.Instructor.Id].Name, MessageDialogStyle.AffirmativeAndNegative) == MessageDialogResult.Affirmative) { Instructors.PayInstructorSalary(item.Instructor.Id, item.Course.Id); } } Globals.RefreshReferenceInformation(); }