private async void Delete_Click(object sender, RoutedEventArgs e) { IList <Note> toBeDeleted = new List <Note>(); // We have to make a temporary list of things to delete as doing so in the loop // will invalidate the IEnumerable foreach (Note note in this.MasterListView.SelectedItems) { toBeDeleted.Add(note); } foreach (var note in toBeDeleted) { await NoteManager.DeleteNoteAsync(note); } }