Beispiel #1
0
        public CheckoutSummaryPageViewModel(INavigationService navigationService,
                                            IOrderService orderService,
                                            IOrderRepository orderRepository,
                                            IShippingMethodService shippingMethodService,
                                            ICheckoutDataRepository checkoutDataRepository,
                                            IShoppingCartRepository shoppingCartRepository,
                                            IAccountService accountService,
                                            IResourceLoader resourceLoader,
                                            IAlertMessageService alertMessageService,
                                            ISignInUserControlViewModel signInUserControlViewModel)
        {
            _navigationService          = navigationService;
            _orderService               = orderService;
            _orderRepository            = orderRepository;
            _shippingMethodService      = shippingMethodService;
            _checkoutDataRepository     = checkoutDataRepository;
            _shoppingCartRepository     = shoppingCartRepository;
            _resourceLoader             = resourceLoader;
            _accountService             = accountService;
            _alertMessageService        = alertMessageService;
            _signInUserControlViewModel = signInUserControlViewModel;

            SubmitCommand = DelegateCommand.FromAsyncHandler(SubmitAsync, CanSubmit);

            EditCheckoutDataCommand   = new DelegateCommand(EditCheckoutData);
            SelectCheckoutDataCommand = new DelegateCommand(async() => await SelectCheckoutDataAsync());
            AddCheckoutDataCommand    = new DelegateCommand(AddCheckoutData);
        }
        public CheckoutSummaryPageViewModel(INavigationService navigationService,
            IOrderService orderService,
            IOrderRepository orderRepository,
            IShippingMethodService shippingMethodService,
            ICheckoutDataRepository checkoutDataRepository,
            IShoppingCartRepository shoppingCartRepository,
            IAccountService accountService,
            IResourceLoader resourceLoader,
            IAlertMessageService alertMessageService,
            ISignInUserControlViewModel signInUserControlViewModel)
        {
            _navigationService = navigationService;
            _orderService = orderService;
            _orderRepository = orderRepository;
            _shippingMethodService = shippingMethodService;
            _checkoutDataRepository = checkoutDataRepository;
            _shoppingCartRepository = shoppingCartRepository;
            _resourceLoader = resourceLoader;
            _accountService = accountService;
            _alertMessageService = alertMessageService;
            _signInUserControlViewModel = signInUserControlViewModel;

            SubmitCommand = DelegateCommand.FromAsyncHandler(SubmitAsync, CanSubmit);

            EditCheckoutDataCommand = new DelegateCommand(EditCheckoutData);
            SelectCheckoutDataCommand = new DelegateCommand(async () => await SelectCheckoutDataAsync());
            AddCheckoutDataCommand = new DelegateCommand(AddCheckoutData);
        }
Beispiel #3
0
        public ShoppingCartPageViewModel(IShoppingCartRepository shoppingCartRepository,
                                         INavigationService navigationService,
                                         IAccountService accountService,
                                         ISignInUserControlViewModel signInUserControlViewModel,
                                         IResourceLoader resourceLoader,
                                         IAlertMessageService alertMessageService,
                                         ICheckoutDataRepository checkoutDataRepository,
                                         IOrderRepository orderRepository,
                                         IEventAggregator eventAggregator)
        {
            _shoppingCartRepository     = shoppingCartRepository;
            _navigationService          = navigationService;
            _accountService             = accountService;
            _signInUserControlViewModel = signInUserControlViewModel;
            _resourceLoader             = resourceLoader;
            _alertMessageService        = alertMessageService;
            _checkoutDataRepository     = checkoutDataRepository;
            _orderRepository            = orderRepository;

            CheckoutCommand       = new DelegateCommand(async() => await CheckoutAsync(), CanCheckout);
            RemoveCommand         = new DelegateCommand <ShoppingCartItemViewModel>(async vm => await Remove(vm));
            IncrementCountCommand = new DelegateCommand(async() => await IncrementCount());
            DecrementCountCommand = new DelegateCommand(async() => await DecrementCount(), CanDecrementCount);

            // Subscribe to the ShoppingCartUpdated event
            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <ShoppingCartUpdatedEvent>().Subscribe(UpdateShoppingCartAsync);
            }
        }
        public ShoppingCartPageViewModel(IShoppingCartRepository shoppingCartRepository,
            INavigationService navigationService,
            IAccountService accountService,
            ISignInUserControlViewModel signInUserControlViewModel,
            IResourceLoader resourceLoader,
            IAlertMessageService alertMessageService,
            ICheckoutDataRepository checkoutDataRepository,
            IOrderRepository orderRepository,
            IEventAggregator eventAggregator)
        {
            _shoppingCartRepository = shoppingCartRepository;
            _navigationService = navigationService;
            _accountService = accountService;
            _signInUserControlViewModel = signInUserControlViewModel;
            _resourceLoader = resourceLoader;
            _alertMessageService = alertMessageService;
            _checkoutDataRepository = checkoutDataRepository;
            _orderRepository = orderRepository;

            CheckoutCommand = DelegateCommand.FromAsyncHandler(CheckoutAsync, CanCheckout);
            RemoveCommand = DelegateCommand<ShoppingCartItemViewModel>.FromAsyncHandler(Remove);
            IncrementCountCommand = DelegateCommand.FromAsyncHandler(IncrementCount);
            DecrementCountCommand = DelegateCommand.FromAsyncHandler(DecrementCount, CanDecrementCount);

            // Subscribe to the ShoppingCartUpdated event
            if (eventAggregator != null)
            {
                eventAggregator.GetEvent<ShoppingCartUpdatedEvent>().Subscribe(UpdateShoppingCartAsync);
            }
        }