Exemplo n.º 1
0
 public DetailProductViewModel(IProductStorageService productService, ICartService cartService, IGlobalEventor globalEventor)
 {
     _productService = productService;
     _cartService    = cartService;
     _globalEventor  = globalEventor;
     _globalEventor.Subscribe <Events.CartChangeEvent>(CartChange);
 }
Exemplo n.º 2
0
 public CartViewModel(ICartService cartService, IOrderService orderService, IGlobalEventor globalEventor)
 {
     _cartService   = cartService;
     _orderService  = orderService;
     _globalEventor = globalEventor;
     _globalEventor.Subscribe <Events.CartChangeEvent>(arg =>
     {
         Cart = _cartService.GetCart();
     });
     Cart = _cartService.GetCart();
 }
Exemplo n.º 3
0
 public ProductsGridViewModel(ISyncService syncService, IProductStorageService productService, ICartService cartService, IFilterService filterService, IGlobalEventor globalEventor)
 {
     _syncService            = syncService;
     _productsStorageService = productService;
     _cartService            = cartService;
     _filterService          = filterService;
     _globalEventor          = globalEventor;
     if (!SyncManager.SyncComplete && _productsStorageService.GetProductsCount() == 0)
     {
         RunSync();
     }
     else
     {
         GetProducts(0, _countProductPerPage);
         RunBackgroundAsync();
         _globalEventor.Subscribe <Events.SyncEvent>(SyncComplate);
     }
 }