private async void _parameters_defined(object sender, BookingParametersViewModel bookingParametersVM) { try { ParametersValidated = true; DateRange dateRange = new DateRange { Start = _parameters.Start, End = _parameters.End }; Options = await OptionsViewModel.CreateAsync(_booking, dateRange); RoomChoices = await RoomsChoiceViewModel.CreateAsync(dateRange); RoomChoices.AvailableRoomChoiceEntitiesView.Filter = _mustShowRoomChoice; _newClientCommand.ChangeCanExecute(); _searchClientCommand.ChangeCanExecute(); _validateBookingCommand.ChangeCanExecute(); } catch (Exception ex) { Logger.Log(ex); } }
public BookingViewModel(LinkedList <INavigableViewModel> navigation, Booking booking, LinkedListNode <INavigableViewModel> prevNode = null) { _pcs = new PropertyChangeSupport(this); _navigation = navigation; _parameters = new BookingParametersViewModel(booking); _parameters.Defined += _parameters_defined; _parameters.PropertyChanged += _parametersChanged; _parametersValidated = false; _booking = booking; _clientEntity = new ClientEntity(_booking.Client); _bookingEntity = new BookingEntity(_booking); _clientEntity.Bookings.Add(_bookingEntity); _computeTitle(_clientEntity); _clientEntity.PropertyChanged += _clientChanged; _searchClientCommand = new DelegateCommandAsync <BookingViewModel>(_searchClient, false); _newClientCommand = new DelegateCommandAsync <BookingViewModel>(_newClient, false); _validateBookingCommand = new DelegateCommandAsync <BookingViewModel>(_validateBooking, false); if (prevNode == null) { _navigation.AddLast(this); } else { _navigation.AddAfter(prevNode, this); } }
public BookingViewModel(LinkedList<INavigableViewModel> navigation, Booking booking, LinkedListNode<INavigableViewModel> prevNode = null) { _pcs = new PropertyChangeSupport(this); _navigation = navigation; _parameters = new BookingParametersViewModel(booking); _parameters.Defined += _parameters_defined; _parameters.PropertyChanged += _parametersChanged; _parametersValidated = false; _booking = booking; _clientEntity = new ClientEntity(_booking.Client); _bookingEntity = new BookingEntity(_booking); _clientEntity.Bookings.Add(_bookingEntity); _computeTitle(_clientEntity); _clientEntity.PropertyChanged += _clientChanged; _searchClientCommand = new DelegateCommandAsync<BookingViewModel>(_searchClient, false); _newClientCommand = new DelegateCommandAsync<BookingViewModel>(_newClient, false); _validateBookingCommand = new DelegateCommandAsync<BookingViewModel>(_validateBooking, false); if (prevNode == null) { _navigation.AddLast(this); } else { _navigation.AddAfter(prevNode, this); } }