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);
            }
        }
 public CategoryPageViewModel(IProductCatalogRepository productCatalogRepository, INavigationService navigationService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
 {
     _productCatalogRepository = productCatalogRepository;
     _navigationService = navigationService;
     _alertMessageService = alertMessageService;
     _resourceLoader = resourceLoader;
 }
        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 ShippingAddressUserControlViewModel(ICheckoutDataRepository checkoutDataRepository, ILocationService locationService, IResourceLoader resourceLoader, IAlertMessageService alertMessageService)
 {
     _address = new Address();
     _checkoutDataRepository = checkoutDataRepository;
     _locationService = locationService;
     _resourceLoader = resourceLoader;
     _alertMessageService = alertMessageService;
 }
 public MainHubPageViewModel(IDriversRepository driversRepository,
     IVehiclesRepository vehiclesRepository,
     IServicesRepository servicesRepository,
     IAlertMessageService alertMessageService) : base(alertMessageService)
 {
     _driversRepository = driversRepository;
     _vehiclesRepository = vehiclesRepository;
     _servicesRepository = servicesRepository;
 }
 // <snippet303>
 public HubPageViewModel(IProductCatalogRepository productCatalogRepository, INavigationService navigationService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, ISearchPaneService searchPaneService)
 {
     _productCatalogRepository = productCatalogRepository;
     _navigationService = navigationService;
     _alertMessageService = alertMessageService;
     _resourceLoader = resourceLoader;
     _searchPaneService = searchPaneService;
     ProductNavigationAction = NavigateToItem;
     GoBackCommand = new DelegateCommand(navigationService.GoBack, navigationService.CanGoBack);
 }
        public ExamSearchPageViewModel(IDataLoaderService dataLoaderService, IAlertMessageService alertMessageService, [Dependency("ExamRequest")] IApiRequestService examRequestService)
        {
            _dataLoaderService = dataLoaderService;
            _examRequestService = examRequestService;
            _alertMessageService = alertMessageService;

            classid = (_dataLoaderService.ReadAppJSONData<StuInfo>(DataKey.StuInfo) as StuInfo).clazz._id;

            Task.Factory.StartNew(GetExamList);
        }
        public BillingAddressPageViewModel(IBillingAddressUserControlViewModel billingAddressViewModel, IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IAccountService accountService, INavigationService navigationService)
        {
            _billingAddressViewModel = billingAddressViewModel;
            _resourceLoader = resourceLoader;
            _alertMessageService = alertMessageService;
            _accountService = accountService;
            _navigationService = navigationService;

            SaveCommand = DelegateCommand.FromAsyncHandler(SaveAsync);
        }
        public ItemDetailPageViewModel(IProductCatalogRepository productCatalogRepository, IShoppingCartRepository shoppingCartRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, ISecondaryTileService secondaryTileService)
        {
            _productCatalogRepository = productCatalogRepository;
            _shoppingCartRepository = shoppingCartRepository;
            _alertService = alertMessageService;
            _resourceLoader = resourceLoader;
            _secondaryTileService = secondaryTileService;

            PinProductCommand = DelegateCommand.FromAsyncHandler(PinProduct, () => SelectedProduct != null);
            UnpinProductCommand = DelegateCommand.FromAsyncHandler(UnpinProduct, () => SelectedProduct != null);
        }
        public ChangeDefaultsFlyoutViewModel(ICheckoutDataRepository checkoutDataRepository, IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IAccountService accountService)
        {
            _checkoutDataRepository = checkoutDataRepository;
            _resourceLoader = resourceLoader;
            _alertMessageService = alertMessageService;
            _accountService = accountService;

            SaveCommand = DelegateCommand.FromAsyncHandler(SaveAsync);

            Initialize();
        }
        public CarHubPageViewModel(IVehiclesRepository vehiclesRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
            : base(alertMessageService)
        {
            _vehiclesRepository = vehiclesRepository;
            _resourceLoader = resourceLoader;

            SelectMonthCommand = new DelegateCommand<object>(SelectMonth);
            SelectYearCommand = new DelegateCommand<object>(SelectYear);
            NextMonthCommand = new DelegateCommand<object>(NextMonth, CanNextMonth);
            PreviousMonthCommand = new DelegateCommand<object>(PreviousMonth, CanPreviousMonth);
        }
        public SignInFlyoutViewModel(IAccountService accountService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
        {
            _accountService = accountService;
            _alertMessageService = alertMessageService;
            _resourceLoader = resourceLoader;
            if (accountService != null)
            {
                _lastSignedInUser = _accountService.SignedInUser;
            }

            SignInCommand = DelegateCommand.FromAsyncHandler(SignInAsync, CanSignIn);
        }
        public ProductViewModel(Product product, IShoppingCartRepository shoppingCartRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            _product = product;
            _shoppingCartRepository = shoppingCartRepository;
            _alertMessageService = alertMessageService;
            _resourceLoader = resourceLoader;

            AddToCartCommand = DelegateCommand.FromAsyncHandler(AddToCart);
        }
Beispiel #14
0
        public ProductViewModel(Product product, IShoppingCartRepository shoppingCartRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
        {
            if (product == null)
            {
                throw new ArgumentNullException("product");
            }

            _product = product;
            _shoppingCartRepository = shoppingCartRepository;
            _alertMessageService    = alertMessageService;
            _resourceLoader         = resourceLoader;

            AddToCartCommand = new DelegateCommand(async() => await AddToCart());
        }
        public HubPageViewModel(IAlertMessageService alertMessageService, INavigationService navService, ROClient roClient)
        {
            _alertMessageService = alertMessageService;
            _navService = navService;
            _roClient = roClient;

            //NavigateToUserInputCommand = new DelegateCommand(() => navService.Navigate("UserInput", null));
            GoBackCommand = new DelegateCommand(navService.GoBack, navService.CanGoBack);

            ProductNavigationAction = NavigateToServiceAction;

            // Not sure why this isn't required in AW equivalent...
            OnNavigatedTo(null, NavigationMode.New, null);
        }
        public WeerPageViewModel(IWeatherRepository weatherRepository, ILocationRepository locationRepository, IVerenigingRepository verenigingRepository, IAlertRepository alertRepository, INavigationService navigationService, IAlertMessageService alertMessageService,
                                 IEventAggregator eventAggregator)
        {
            _weatherRepository    = weatherRepository;
            _locationRepository   = locationRepository;
            _verenigingRepository = verenigingRepository;
            _alertRepository      = alertRepository;
            _navigationService    = navigationService;
            _alertMessageService  = alertMessageService;
            _eventAggregator      = eventAggregator;

            _eventAggregator.GetEvent <WeatherUpdatedEvent>().Subscribe(UpdateWeatherPageAsync);

            UpdateWeatherAsync(false);
        }
        public SignInPageViewModel(IAccountService accountService, IAlertMessageService alertMessageService,
                                   IResourceLoader resourceLoader, INavigationService navigationService)
        {
            _accountService      = accountService;
            _alertMessageService = alertMessageService;
            _resourceLoader      = resourceLoader;
            _navigationService   = navigationService;
            _saveCredentials     = true;

            SignInCommand           = DelegateCommand.FromAsyncHandler(SignInAsync, CanSignIn);
            GoBackCommand           = new DelegateCommand(Close);
            SignUpNavigationCommand = new DelegateCommand(NavigateToSignUp);

            // CheckUserSavedCredential();
        }
        public PaymentMethodPageViewModel(IPaymentMethodUserControlViewModel paymentMethodViewModel, 
            ICheckoutDataRepository checkoutDataRepository,
            IResourceLoader resourceLoader, 
            IAlertMessageService alertMessageService, 
            IAccountService accountService, 
            INavigationService navigationService)
        {
            _paymentMethodViewModel = paymentMethodViewModel;
            _checkoutDataRepository = checkoutDataRepository;
            _resourceLoader = resourceLoader;
            _alertMessageService = alertMessageService;
            _accountService = accountService;
            _navigationService = navigationService;

            SaveCommand = DelegateCommand.FromAsyncHandler(SaveAsync);
        }
Beispiel #19
0
        public ConfirmRegistrationPageViewModel(IAlertMessageService alertMessageService, INavigationService navigationService, IAccountService accountService, IClientDeveloperService clientDeveloperService, IResourceLoader resourceLoader)
        {
            _navigationService      = navigationService;
            _accountService         = accountService;
            _clientDeveloperService = clientDeveloperService;
            _alertMessageService    = alertMessageService;
            _resourceLoader         = resourceLoader;

            _activationCommandEnabled           = true;
            _resendActivationCodeCommandEnabled = true;

            ActivateAccountCommand = DelegateCommand.FromAsyncHandler(ActivateAccountAsync,
                                                                      CanActivateAccount);
            ResendActivationCodeCommand = DelegateCommand.FromAsyncHandler(ResendActivationCodeAsync,
                                                                           CanResendActivationCode);
        }
Beispiel #20
0
        public PaymentMethodPageViewModel(IPaymentMethodUserControlViewModel paymentMethodViewModel,
                                          ICheckoutDataRepository checkoutDataRepository,
                                          IResourceLoader resourceLoader,
                                          IAlertMessageService alertMessageService,
                                          IAccountService accountService,
                                          INavigationService navigationService)
        {
            _paymentMethodViewModel = paymentMethodViewModel;
            _checkoutDataRepository = checkoutDataRepository;
            _resourceLoader         = resourceLoader;
            _alertMessageService    = alertMessageService;
            _accountService         = accountService;
            _navigationService      = navigationService;

            SaveCommand = new DelegateCommand(async() => await SaveAsync());
        }
        public CheckoutHubPageViewModel(INavigationService navigationService, IAccountService accountService, IOrderRepository orderRepository, IShoppingCartRepository shoppingCartRepository,
                                        IShippingAddressUserControlViewModel shippingAddressViewModel, IBillingAddressUserControlViewModel billingAddressViewModel, IPaymentMethodUserControlViewModel paymentMethodViewModel,
                                        IResourceLoader resourceLoader, IAlertMessageService alertMessageService)
        {
            _navigationService        = navigationService;
            _accountService           = accountService;
            _orderRepository          = orderRepository;
            _shoppingCartRepository   = shoppingCartRepository;
            _shippingAddressViewModel = shippingAddressViewModel;
            _billingAddressViewModel  = billingAddressViewModel;
            _paymentMethodViewModel   = paymentMethodViewModel;
            _alertMessageService      = alertMessageService;
            _resourceLoader           = resourceLoader;

            GoNextCommand = new DelegateCommand(GoNext);
        }
Beispiel #22
0
        public MainPageViewModel(INavigationService navigationService, IDataLoaderService dataLoaderService,
                                 [Dependency("EcardRequest")] IApiRequestService ecardRequestService, IAlertMessageService alertMessageService)
        {
            _navigationService = navigationService;
            _dataLoaderService = dataLoaderService;
            _ecardRequestService = ecardRequestService;
            _alertMessageService = alertMessageService;

            Task.Factory.StartNew(GetEcardInfoAsync);

            NaviListCommands = new ObservableCollection<NaviButtonViewModel>()
            {
                new NaviButtonViewModel() {Text = "成绩查询", PageToken = PageTokens.ScoreSearchPage, Command = NaviBtnNavigateCommand },
                new NaviButtonViewModel() {Text = "考试安排", PageToken = PageTokens.ExamSearchPage, Command = NaviBtnNavigateCommand }
            };

        }
        public CheckoutHubPageViewModel(INavigationService navigationService, IAccountService accountService, IOrderRepository orderRepository, IShoppingCartRepository shoppingCartRepository,
                                        IShippingAddressUserControlViewModel shippingAddressViewModel, IBillingAddressUserControlViewModel billingAddressViewModel, IPaymentMethodUserControlViewModel paymentMethodViewModel,
                                        IFlyoutService flyoutService, IResourceLoader resourceLoader, IAlertMessageService alertMessageService)
        {
            _navigationService = navigationService;
            _accountService = accountService;
            _orderRepository = orderRepository;
            _shoppingCartRepository = shoppingCartRepository;
            _shippingAddressViewModel = shippingAddressViewModel;
            _billingAddressViewModel = billingAddressViewModel;
            _paymentMethodViewModel = paymentMethodViewModel;
            _flyoutService = flyoutService;
            _alertMessageService = alertMessageService;
            _resourceLoader = resourceLoader;

            GoBackCommand = new DelegateCommand(navigationService.GoBack, navigationService.CanGoBack);
            GoNextCommand = new DelegateCommand(GoNext);
        }
Beispiel #24
0
        public SignInUserControlViewModel(IAccountService accountService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
        {
            _accountService      = accountService;
            _alertMessageService = alertMessageService;
            _resourceLoader      = resourceLoader;

            SignInCommand = DelegateCommand.FromAsyncHandler(SignInAsync, CanSignIn);
            GoBackCommand = new DelegateCommand(Close);

            if (_accountService.SignedInUser != null)
            {
                _userName   = _accountService.SignedInUser.UserName;
                IsNewSignIn = false;
            }
            else
            {
                IsNewSignIn = true;
            }
        }
        public ShoppingCartTabUserControlViewModel(IShoppingCartRepository shoppingCartRepository, IEventAggregator eventAggregator, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, IAccountService accountService)
        {
            _itemCount = 0; //ItemCount will be set using async method call.

            _shoppingCartRepository = shoppingCartRepository;
            _alertMessageService    = alertMessageService;
            _resourceLoader         = resourceLoader;
            _accountService         = accountService;

            if (eventAggregator != null)
            {
                // Documentation on loosely coupled communication is at http://go.microsoft.com/fwlink/?LinkID=288820&clcid=0x409
                eventAggregator.GetEvent <ShoppingCartUpdatedEvent>().Subscribe(UpdateItemCountAsync);
                eventAggregator.GetEvent <ShoppingCartItemUpdatedEvent>().Subscribe(UpdateItemCountAsync);
            }

            //Start process of updating item count.
            UpdateItemCountAsync(null);
        }
        public ItemDetailPageViewModel(IProductCatalogRepository productCatalogRepository, INavigationService navigationService, IShoppingCartRepository shoppingCartRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, ITileService tileService, ISearchPaneService searchPaneService)
        {
            _productCatalogRepository = productCatalogRepository;
            _shoppingCartRepository = shoppingCartRepository;
            _alertService = alertMessageService;
            _resourceLoader = resourceLoader;
            _tileService = tileService;
            _searchPaneService = searchPaneService;
            _isAppBarSticky = false;

            GoBackCommand = new DelegateCommand(navigationService.GoBack, navigationService.CanGoBack);
            AddToCartCommand = DelegateCommand.FromAsyncHandler(AddToCart, CanAddToCart);
            // <snippet802>
            PinProductCommand = DelegateCommand.FromAsyncHandler(PinProduct, () => SelectedProduct != null);
            // </snippet802>
            // <snippet805>
            UnpinProductCommand = DelegateCommand.FromAsyncHandler(UnpinProduct, () => SelectedProduct != null);
            // </snippet805>
        }
        public SignInUserControlViewModel(IAccountService accountService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
        {
            _accountService = accountService;
            _alertMessageService = alertMessageService;
            _resourceLoader = resourceLoader;

            SignInCommand = DelegateCommand.FromAsyncHandler(SignInAsync, CanSignIn);
            GoBackCommand = new DelegateCommand(Close);

            if (_accountService.SignedInUser != null)
            {
                _userName = _accountService.SignedInUser.UserName;
                IsNewSignIn = false;
            }
            else
            {
                IsNewSignIn = true;
            }
        }
        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 #29
0
        //private StorageFile _storageFile;
        //public Foto _weerIcoon;

        public WeerUserControlViewModel(IWeatherRepository weatherRepository, ILocationRepository locationRepository, IVerenigingRepository verenigingRepository, IAlertRepository alertRepository, INavigationService navigationService, IAlertMessageService alertMessageService,
                                        IEventAggregator eventAggregator)
        {
            _weatherRepository    = weatherRepository;
            _locationRepository   = locationRepository;
            _verenigingRepository = verenigingRepository;
            _alertRepository      = alertRepository;
            _navigationService    = navigationService;
            _alertMessageService  = alertMessageService;
            _eventAggregator      = eventAggregator;

            weatherTimer          = new DispatcherTimer();
            weatherTimer.Interval = TimeSpan.FromMinutes(30);
            weatherTimer.Tick    += weatherTimer_Tick;
            weatherTimer.Start();

            _eventAggregator.GetEvent <WeatherUpdatedEvent>().Subscribe(UpdateWeatherAsync);

            UpdateWeatherAsync(false);
        }
        public SignUpPageViewModel( //IAccountService accountService,
            IAlertMessageService alertMessageService,
            IResourceLoader resourceLoader,
            INavigationService navigationService,
            INaturalPersonUserControlViewModel naturalPersonViewModel,
            ILegalPersonUserControlViewModel legalPersonViewModel,
            ICredentialUserControlViewModel credentialViewModel)
        {
            // _user = new User();
            //_accountService = accountService;
            _alertMessageService        = alertMessageService;
            _resourceLoader             = resourceLoader;
            _navigationService          = navigationService;
            this.NaturalPersonViewModel = naturalPersonViewModel;
            this.LegalPersonViewModel   = legalPersonViewModel;
            this.CredentialViewModel    = credentialViewModel;

            SignUpCommand = DelegateCommand.FromAsyncHandler(SignUpAsync, CanSignUp);
            //GoBackCommand = new DelegateCommand(GoBack);
        }
        public ShoppingCartTabUserControlViewModel(IShoppingCartRepository shoppingCartRepository, IEventAggregator eventAggregator, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, IAccountService accountService)
        {
            // ItemCount will be set using async method call.
            _itemCount = 0;

            _shoppingCartRepository = shoppingCartRepository;
            _alertMessageService = alertMessageService;
            _resourceLoader = resourceLoader;
            _accountService = accountService;

            if (eventAggregator != null)
            {
                // Documentation on loosely coupled communication is at http://go.microsoft.com/fwlink/?LinkID=288820&clcid=0x409
                eventAggregator.GetEvent<ShoppingCartUpdatedEvent>().Subscribe(UpdateItemCountAsync);
                eventAggregator.GetEvent<ShoppingCartItemUpdatedEvent>().Subscribe(UpdateItemCountAsync);
            }

            // Start process of updating item count.
            UpdateItemCountAsync(null);
        }
 public ServiceBase(
     IAppSettingsService appSettingsService,
     IAlertMessageService alertMessageService,
     IResourceLoader resourceLoader)
 {
     if (appSettingsService == null)
     {
         throw new ArgumentNullException("appSettingsService");
     }
     if (alertMessageService == null)
     {
         throw new ArgumentNullException("alertMessageService");
     }
     if (resourceLoader == null)
     {
         throw new ArgumentNullException("resourceLoader");
     }
     _settingsService = appSettingsService;
     _alertService    = alertMessageService;
     _resourceLoader  = resourceLoader;
 }
        public ShoppingCartTabUserControlViewModel(IShoppingCartRepository shoppingCartRepository, IEventAggregator eventAggregator, INavigationService navigationService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, IAccountService accountService)
        {
            _itemCount = 0; //ItemCount will be set using async method call.

            _shoppingCartRepository = shoppingCartRepository;
            _navigationService = navigationService;
            _alertMessageService = alertMessageService;
            _resourceLoader = resourceLoader;
            _accountService = accountService;

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent<ShoppingCartUpdatedEvent>().Subscribe(UpdateItemCountAsync);
                eventAggregator.GetEvent<ShoppingCartItemUpdatedEvent>().Subscribe(UpdateItemCountAsync);
            }

            ShoppingCartTabCommand = new DelegateCommand(NavigateToShoppingCartPage);

            //Start process of updating item count.
            UpdateItemCountAsync(null);
        }
Beispiel #34
0
        public LoginPageViewModel(INavigationService navigationService,
            [Dependency("LoginRequest")] IApiRequestService loginRequestService,
            [Dependency("StuInfoRequest")] IApiRequestService stuInfoRequestService,
            IDataLoaderService dataLoaderService,
            IAlertMessageService alertMessageService)
        {
            _navigationService = navigationService;
            _dataLoaderService = dataLoaderService;
            _loginRequestService = loginRequestService;
            _stuInfoRequestService = stuInfoRequestService;
            _alertMessageService = alertMessageService;


            Busy = false;

            if (IsAuto)
            {
                Email = _dataLoaderService.ReadAppData(DataKey.Email) as string;
                Pwd = _dataLoaderService.ReadAppData(DataKey.Pwd) as string;
                ForwardBtnCommand.Execute(null);
            }
        }
Beispiel #35
0
        public CloudUserControlViewModel(IAlertRepository alertRepository, INavigationService navigationService, IAlertMessageService alertMessageService,
                                         IEventAggregator eventAggregator)
        {
            _alertRepository     = alertRepository;
            _navigationService   = navigationService;
            _alertMessageService = alertMessageService;
            _eventAggregator     = eventAggregator;

            cloudTimer = new DispatcherTimer();

            cloudTimer.Interval = TimeSpan.FromMilliseconds(200);
            cloudTimer.Tick    += cloudTimer_Tick;
            cloudTimer.Start();

            cloudRefreshTimer          = new DispatcherTimer();
            cloudRefreshTimer.Interval = TimeSpan.FromMinutes(30);
            cloudRefreshTimer.Tick    += cloudRefreshTimer_Tick;
            cloudRefreshTimer.Start();

            _eventAggregator.GetEvent <CloudUpdatedEvent>().Subscribe(UpdateCloudsAsync);

            UpdateCloudsAsync(false);
        }
        public ShoppingCartPageViewModel(IShoppingCartRepository shoppingCartRepository, INavigationService navigationService, IAccountService accountService,
                                         IFlyoutService flyoutService, IResourceLoader resourceLoader, IAlertMessageService alertMessageService,
                                         ICheckoutDataRepository checkoutDataRepository, IOrderRepository orderRepository, IEventAggregator eventAggregator)
        {
            _shoppingCartRepository = shoppingCartRepository;
            _navigationService = navigationService;
            _accountService = accountService;
            _flyoutService = flyoutService;
            _resourceLoader = resourceLoader;
            _alertMessageService = alertMessageService;
            _checkoutDataRepository = checkoutDataRepository;
            _orderRepository = orderRepository;

            CheckoutCommand = DelegateCommand.FromAsyncHandler(CheckoutAsync, CanCheckout);
            EditAmountCommand = new DelegateCommand(OpenEditAmountFlyout);
            RemoveCommand = DelegateCommand<ShoppingCartItemViewModel>.FromAsyncHandler(Remove);
            GoBackCommand = new DelegateCommand(navigationService.GoBack);
            IncrementCountCommand = DelegateCommand.FromAsyncHandler(IncrementCount);
            DecrementCountCommand = DelegateCommand.FromAsyncHandler(DecrementCount, CanDecrementCount);

            // Subscribe to the ShoppingCartUpdated event
            eventAggregator.GetEvent<ShoppingCartUpdatedEvent>().Subscribe(UpdateShoppingCartAsync);
        }
//        private bool _isBottomAppBarSticky;
//        private bool _isBottomAppBarOpened;
//        private int? _selectedIndex;

        public ObjectActionPageViewModel(
            /*IProductCatalogRepository productCatalogRepository, */
            INavigationService navigationService
            /*, IShoppingCartRepository shoppingCartRepository*/
            , IAlertMessageService alertMessageService
            /*, IResourceLoader resourceLoader,  ISecondaryTileService secondaryTileService, ISearchPaneService searchPaneService*/)
        {
//            _productCatalogRepository = productCatalogRepository;
//            _shoppingCartRepository = shoppingCartRepository;
            _alertService = alertMessageService;
//            _resourceLoader = resourceLoader;
//            _secondaryTileService = secondaryTileService;
//            _searchPaneService = searchPaneService;

            GoBackCommand = new DelegateCommand(navigationService.GoBack, navigationService.CanGoBack);

//            // <snippet802>
//            PinProductCommand = DelegateCommand.FromAsyncHandler(PinProduct, () => SelectedProduct != null);
//            // </snippet802>
//            // <snippet805>
//            UnpinProductCommand = DelegateCommand.FromAsyncHandler(UnpinProduct, () => SelectedProduct != null);
//            // </snippet805>
        }
        //private bool _huidig;
        //private bool _bestaand;

        public CardPageViewModel(IVerenigingRepository verenigingRepository, ISpelerRepository spelerRepository, IReserveringRepository reserveringRepository, INavigationService navigationService,
                                 IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IEventAggregator eventAggregator)
        {
            _verenigingRepository  = verenigingRepository;
            _spelerRepository      = spelerRepository;
            _reserveringRepository = reserveringRepository;
            _navigationService     = navigationService;
            _resourceLoader        = resourceLoader;
            _alertMessageService   = alertMessageService;
            _eventAggregator       = eventAggregator;

            if (_eventAggregator != null)
            {
                _eventAggregator.GetEvent <CardUpdatedEvent>().Subscribe(UpdateCardAsync);
            }

            KeyUpCommand  = new DelegateCommand <KeyRoutedEventArgs>(KeyUp);
            GoBackCommand = new DelegateCommand(_navigationService.GoBack);
            //GoNextCommand = new DelegateCommand<string>(GoNext);
            GoNextCommand = new DelegateCommand(GoNext);

            UpdateCardAsync(null);
        }
        public BaanUserControlViewModel(Baan baan, IBaanRepository baanRepository, IReserveringRepository reserveringRepository, IVerenigingRepository verenigingRepository, INavigationService navigationService,
                                        IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IEventAggregator eventAggregator)
        {
            if (baan == null)
            {
                throw new ArgumentNullException("Baan", "baan cannot be null");
            }

            _baan                  = baan;
            _baanRepository        = baanRepository;
            _reserveringRepository = reserveringRepository;
            _verenigingRepository  = verenigingRepository;
            _navigationService     = navigationService;
            _resourceLoader        = resourceLoader;
            _alertMessageService   = alertMessageService;
            _eventAggregator       = eventAggregator;


            BaanNavigationCommand  = new DelegateCommand(NavigateToBanen);
            SelecterenBaanCommand  = new DelegateCommand(SelecteerBaan);
            VerwijderenBaanCommand = new DelegateCommand(VerwijderBaan);

            UpdateBaanAsync(baan);
        }
Beispiel #40
0
        public ReserveringPageViewModel(IReserveringRepository reserveringRepository, IBaanRepository baanRepository, ISpelerRepository spelerRepository, IVerenigingRepository verenigingRepository, INavigationService navigationService,
                                        IResourceLoader resourceLoader, IAlertMessageService alertMessageService,
                                        IEventAggregator eventAggregator)
        {
            _reserveringRepository = reserveringRepository;
            _baanRepository        = baanRepository;
            _spelerRepository      = spelerRepository;
            _verenigingRepository  = verenigingRepository;
            _navigationService     = navigationService;
            _resourceLoader        = resourceLoader;
            _alertMessageService   = alertMessageService;
            _eventAggregator       = eventAggregator;

            BevestigenCommand  = new DelegateCommand <Nullable <Guid> >(ReserveringBevestigen);
            AnnulerenCommand   = new DelegateCommand(ReserveringAnnuleren);
            VerwijderenCommand = new DelegateCommand <Nullable <Guid> >(ReserveringVerwijderen);

            if (eventAggregator != null)
            {
                eventAggregator.GetEvent <ReserveringUpdatedEvent>().Subscribe(UpdateReserveringAsync);
            }

            UpdateReserveringAsync(null);
        }
        public BillingAddressPageViewModel(IBillingAddressUserControlViewModel billingAddressViewModel, IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IAccountService accountService, INavigationService navigationService)
        {
            _billingAddressViewModel = billingAddressViewModel;
            _resourceLoader          = resourceLoader;
            _alertMessageService     = alertMessageService;
            _accountService          = accountService;
            _navigationService       = navigationService;

            SaveCommand = DelegateCommand.FromAsyncHandler(SaveAsync);
        }
 public SearchResultsPageViewModel(IProductCatalogRepository productCatalogRepository, IResourceLoader resourceLoader, IAlertMessageService alertMessageService)
 {
     _productCatalogRepository = productCatalogRepository;
     _resourceLoader = resourceLoader;
     _alertMessageService = alertMessageService;
 }
 protected BaseViewModel(IAlertMessageService alertMessageService)
 {
     _alertMessageService = alertMessageService;
 }
Beispiel #44
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 = 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);
            }
        }
        public AppVersionSpecificationPageViewModel(INavigationService navigationService, IAppService appService, IClientDeveloperService developerService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, IVersionUserControlViewModel versionViewModel)
        {
            _appService          = appService;
            _navigationService   = navigationService;
            _developerService    = developerService;
            _resourceLoader      = resourceLoader;
            _alertMessageService = alertMessageService;

            this.VersionViewModel = versionViewModel;
        }
Beispiel #46
0
        public ItemDetailPageViewModel(IProductCatalogRepository productCatalogRepository, IShoppingCartRepository shoppingCartRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader, ISecondaryTileService secondaryTileService)
        {
            _productCatalogRepository = productCatalogRepository;
            _shoppingCartRepository   = shoppingCartRepository;
            _alertService             = alertMessageService;
            _resourceLoader           = resourceLoader;
            _secondaryTileService     = secondaryTileService;

            PinProductCommand   = new DelegateCommand(async() => await PinProduct(), () => SelectedProduct != null);
            UnpinProductCommand = new DelegateCommand(async() => await UnpinProduct(), () => SelectedProduct != null);
        }
 public SetupUserControlViewModel(IAlertMessageService alertService)
 {
     _alertService = alertService;
     SaveCommand   = new DelegateCommand(Save, CanSave);
     Load();
 }
 public GroupDetailPageViewModel(IProductCatalogRepository productCatalogRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
 {
     _productCatalogRepository = productCatalogRepository;
     _alertMessageService      = alertMessageService;
     _resourceLoader           = resourceLoader;
 }
 public MainPageViewModel(IHubConnectionBuilder builder, IDispatcher dispatcher, IAlertMessageService alertService)
 {
     SendMessage  = new DelegateCommand <string>(DoSendMessage);
     Connect      = new DelegateCommand(DoConnect);
     Disconnect   = new DelegateCommand(DoDisconnect);
     Connection   = builder.Build();
     Dispatcher   = dispatcher;
     AlertService = alertService;
 }
Beispiel #50
0
 public CategoryPageViewModel(IProductCatalogRepository productCatalogRepository, INavigationService navigationService, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
 {
     _productCatalogRepository = productCatalogRepository;
     _navigationService        = navigationService;
     _alertMessageService      = alertMessageService;
     _resourceLoader           = resourceLoader;
 }
Beispiel #51
0
        private void ShowErrorMessage(string errorMessage, string title)
        {
            IAlertMessageService alertMessageService = (IAlertMessageService)Container.Resolve(typeof(IAlertMessageService));

            alertMessageService.ShowAsync(errorMessage, title, DialogCommands.CloseDialogCommand);
        }
 public GroupDetailPageViewModel(IProductCatalogRepository productCatalogRepository, IAlertMessageService alertMessageService, IResourceLoader resourceLoader)
 {
     _productCatalogRepository = productCatalogRepository;
     _alertMessageService = alertMessageService;
     _resourceLoader = resourceLoader;
 }
Beispiel #53
0
 public SpelerUserControlViewModel(Speler speler, ISpelerRepository spelerRepository, IReserveringRepository reserveringRepository, IVerenigingRepository verenigingRepository, INavigationService navigationService,
                                   IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IEventAggregator eventAggregator)
 {
     return;
 }
        public ShippingAddressPageViewModel(IShippingAddressUserControlViewModel shippingAddressViewModel, IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IAccountService accountService, INavigationService navigationService)
        {
            _shippingAddressViewModel = shippingAddressViewModel;
            _resourceLoader           = resourceLoader;
            _alertMessageService      = alertMessageService;
            _accountService           = accountService;
            _navigationService        = navigationService;

            SaveCommand = new DelegateCommand(async() => await SaveAsync());
        }
Beispiel #55
0
 public SearchResultsPageViewModel(IProductCatalogRepository productCatalogRepository, IResourceLoader resourceLoader, IAlertMessageService alertMessageService)
 {
     _productCatalogRepository = productCatalogRepository;
     _resourceLoader           = resourceLoader;
     _alertMessageService      = alertMessageService;
 }
        public ChangeDefaultsFlyoutViewModel(ICheckoutDataRepository checkoutDataRepository, IResourceLoader resourceLoader, IAlertMessageService alertMessageService, IAccountService accountService)
        {
            _checkoutDataRepository = checkoutDataRepository;
            _resourceLoader         = resourceLoader;
            _alertMessageService    = alertMessageService;
            _accountService         = accountService;

            SaveCommand = new DelegateCommand(async() => await SaveAsync());

            Initialize();
        }