/// <summary>
        /// Initializes a new instance for the <see cref="DetailPageViewModel" /> class.
        /// </summary>
        public DetailPageViewModel(string callerPage, ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                   IWishlistDataService wishlistDataService, Product selectedProduct)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;
            this.selectedProduct     = selectedProduct;

            Device.BeginInvokeOnMainThread(() =>
            {
                AddRecentProduct(selectedProduct.ID.ToString());
                FetchProduct(selectedProduct.ID.ToString());
                UpdateCartItemCount();
            });

            AddFavouriteCommand = new DelegateCommand(AddFavouriteClicked);
            NotificationCommand = new DelegateCommand(NotificationClicked);
            AddToCartCommand    = new DelegateCommand(AddToCartClicked);
            LoadMoreCommand     = new DelegateCommand(LoadMoreClicked);
            ShareCommand        = new DelegateCommand(ShareClicked);
            VariantCommand      = new DelegateCommand(VariantClicked);
            CardItemCommand     = new DelegateCommand(CartClicked);
            BackButtonCommand   = new DelegateCommand(BackButtonClicked);


            MessagingCenter.Subscribe <RecorderViewModel, PredictionData>(this, callerPage, MessageCenterSubmitAsync);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance for the <see cref="CatalogPageViewModel" /> class.
        /// </summary>
        public CatalogPageViewModel(ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                    IWishlistDataService wishlistDataService, string selectedCategory)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;

            Device.BeginInvokeOnMainThread(() =>
            {
                UpdateCartItemCount();
                FetchProducts(selectedCategory);
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance for the <see cref="CatalogPageViewModel" /> class.
        /// </summary>
        public CatalogPageViewModel(string callerPage, ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                    IWishlistDataService wishlistDataService, string selectedCategory)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;

            Device.BeginInvokeOnMainThread(() =>
            {
                UpdateCartItemCount();
                FetchProducts(selectedCategory);
            });

            MessagingCenter.Subscribe <RecorderViewModel, PredictionData>(this, callerPage, MessageCenterSubmitAsync);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance for the <see cref="DetailPageViewModel" /> class.
        /// </summary>
        public DetailPageViewModel(ICatalogDataService catalogDataService, ICartDataService cartDataService,
                                   IWishlistDataService wishlistDataService, Product selectedProduct)
        {
            this.catalogDataService  = catalogDataService;
            this.cartDataService     = cartDataService;
            this.wishlistDataService = wishlistDataService;
            this.selectedProduct     = selectedProduct;

            Device.BeginInvokeOnMainThread(() =>
            {
                AddRecentProduct(selectedProduct.ID.ToString());
                FetchProduct(selectedProduct.ID.ToString());
                UpdateCartItemCount();
            });

            AddFavouriteCommand = new DelegateCommand(AddFavouriteClicked);
            NotificationCommand = new DelegateCommand(NotificationClicked);
            AddToCartCommand    = new DelegateCommand(AddToCartClicked);
            LoadMoreCommand     = new DelegateCommand(LoadMoreClicked);
            ShareCommand        = new DelegateCommand(ShareClicked);
            VariantCommand      = new DelegateCommand(VariantClicked);
            CardItemCommand     = new DelegateCommand(CartClicked);
            BackButtonCommand   = new DelegateCommand(BackButtonClicked);
        }
 /// <summary>
 /// Initializes a new instance for the <see cref="WishlistViewModel" /> class.
 /// </summary>
 public WishlistViewModel(IWishlistDataService wishlistDataService, ICartDataService cartDataService)
 {
     this.wishlistDataService = wishlistDataService;
     this.cartDataService     = cartDataService;
 }