private void SwitchBookingView(BookingViews type) { switch (type) { case BookingViews.Tee: { SwitchToTeeBookingCommandExecuted(); break; } case BookingViews.Group: { SwitchToGroupBookingCommandExecuted(); break; } case BookingViews.Event: { SwitchToEventBookingCommandExecuted(); break; } case BookingViews.Competition: { SwitchToCompetitionBookingCommandExecuted(); break; } case BookingViews.Match: { SwitchToMatchBookingCommandExecuted(); break; } } }
public BookingView(BookingViews type, ModelBase model = null, bool IsDuplicate = false) { InitializeComponent(); if (model != null) this.Header = "Edit Booking"; DataContext = ViewModel = new BookingViewModel(type, model,IsDuplicate); Owner = Application.Current.MainWindow; }
public BookingView(BookingViews type, ModelBase model = null, bool IsDuplicate = false) { InitializeComponent(); if (model != null) { this.Header = "Edit Booking"; } DataContext = ViewModel = new BookingViewModel(type, model, IsDuplicate); Owner = Application.Current.MainWindow; }
public BookingViewModel(BookingViews type, ModelBase model, bool IsDuplicate) { _model = model; // TODO: Remove "() => false" when tab will be completed. SwitchToTeeBookingCommand = new RelayCommand(SwitchToTeeBookingCommandExecuted, () => false); SwitchToGroupBookingCommand = new RelayCommand(SwitchToGroupBookingCommandExecuted, () => false); SwitchToEventBookingCommand = new RelayCommand(SwitchToEventBookingCommandExecuted); SwitchToCompetitionBookingCommand = new RelayCommand(SwitchToCompetitionBookingCommandExecuted, () => false); SwitchToMatchBookingCommand = new RelayCommand(SwitchToMatchBookingCommandExecuted, () => false); if (IsDuplicate) { Content = new EventBookingView(_model as EventModel, IsDuplicate); } else { SwitchBookingView(type); } }