//====================================================================================================
        public AddBookingViewModel(IMessageBoxService mboxService, IConfigService configService, 
            IParentVm parent, Booking model)
        {
            _parent = parent;
            _mboxService = mboxService;
            _configService = configService;

            //Get Configuration
            AvailableDurations = _configService.GetAvailableDurations();

            //Set Commands
            SubmitCommand = new ActionCommand(OnSubmit, _=>_isFormValid);
            CancelCommand = new ActionCommand(OnCancel);

            //Set up the screen for Add or Display.
            if (model.Id == -1)
            {
                Model = model;
                Caption = "Add New Booking";
                IsAddMode = true;
            }
            else
            {
                Model = model;
                Caption = "Existing Booking";
                IsAddMode = false;
            }
        }
Exemplo n.º 2
0
 public ChildViewModel(IParentVm parent)
 {
     _parent         = parent;
     _testProperty   = "";
     ToggleSomething = new RelayCommand(InternalToggleSomething, InternalCanToggleSomething);
 }
Exemplo n.º 3
0
 public ChildViewModel(IParentVm parent)
 {
     _parent = parent;
     _testProperty = "";
     ToggleSomething = new RelayCommand(InternalToggleSomething, InternalCanToggleSomething);
 }