private void OnDeleteReservationCommand() { if (ReservationData.Contains(this.Reservation)) { ReservationData.Remove(this.Reservation); this.Reservation = null; } }
private void OnUpdateReservationCommand() { if (ReservationData.Contains(this.Reservation)) { ReservationWindow window = new ReservationWindow(); Reservation currentReservation = new Reservation(); currentReservation.Copy(Reservation); (window.DataContext as ReservationWindowViewModel).Reservation = currentReservation; bool?result = window.ShowDialog(); if (result == true) { reservation.Copy(currentReservation); } } }