private async void BookPassengerButton_Click(object sender, RoutedEventArgs e) { string error = String.Empty; if (FirstName == String.Empty) { error += "First name can't be empty\n"; } if (LastName == String.Empty) { error += "Last name can't be empty\n"; } if (PhoneNumber == String.Empty) { error += "Phone Number can't be empty\n"; } if (SelectedIndex == -1) { error += "You need to select a seat number\n"; } if (error == String.Empty) { this.AllSeats = BookingViewModel.BookSeat(new Seat() { FirstName = FirstName, LastName = LastName, Company = Company, PhoneNumber = PhoneNumber, Number = SelectedSeat.Number, IsBooked = true }); var dialog = new MessageDialog(String.Format("Seat #{0} booked succesfully.", SelectedSeat.Number)); await dialog.ShowAsync(); this.Frame.GoBack(); } else { var dialog = new MessageDialog(error); await dialog.ShowAsync(); } }