public OrderDetailViewModel(Account account, Order order = null)
        {
            Account = account;

            if (order == null)
            {
                Order = new Order()
                {
                    AccountId = Account.Id
                };
            }
            else
            {
                Order = order;
            }

            this.Title = "Order Details";

            _DataManager = DependencyService.Get <ICustomerDataClient>();

            _CatalogDataClient = DependencyService.Get <ICatalogDataClient>();

            DependencyService.Get <ILocalize>();

            MessagingCenter.Subscribe <CatalogProduct>(this, MessagingServiceConstants.UPDATE_ORDER_PRODUCT, async catalogProduct =>
            {
                Order.Item        = catalogProduct.Name;
                Order.Price       = catalogProduct.Price;
                OrderItemImageUrl = null;
                await ExecuteLoadOrderItemImageUrlCommand();     // this is to account for Android not calling OnAppearing() when the product selection modal disappears.
                OnPropertyChanged("Order");
            });
        }
        public OrderDetailViewModel(Account account, Order order = null)
        {
            Account = account;

            if (order == null)
            {
                Order = new Order() { AccountId = Account.Id };
            }
            else
            {
                Order = order;
            }

            this.Title = "Order Details";

            _DataManager = DependencyService.Get<ICustomerDataClient>();

            _CatalogDataClient = DependencyService.Get<ICatalogDataClient>();

            DependencyService.Get<ILocalize>();

            MessagingCenter.Subscribe<CatalogProduct>(this, MessagingServiceConstants.UPDATE_ORDER_PRODUCT, async catalogProduct =>
                {
                    Order.Item = catalogProduct.Name;
                    Order.Price = catalogProduct.Price;
                    OrderItemImageUrl = null;
                    await ExecuteLoadOrderItemImageUrlCommand(); // this is to account for Android not calling OnAppearing() when the product selection modal disappears.
                    OnPropertyChanged("Order");
                }); 
        }
        public CategoriesViewModel(CatalogCategory category = null)
        {
            Category = category;

            SubCategories = new ObservableCollection <CatalogCategory>();

            _CatalogClient = DependencyService.Get <ICatalogDataClient>();
        }
Example #4
0
        public ProductsViewModel(string categoryId = null)
        {
            _CategoryId = categoryId;

            _Products = new ObservableCollection <CatalogProduct>();

            _CatalogClient = DependencyService.Get <ICatalogDataClient>();
        }
        public CategoriesViewModel(CatalogCategory category = null)
        {
            Category = category;

            SubCategories = new ObservableCollection<CatalogCategory>();

            _CatalogClient = DependencyService.Get<ICatalogDataClient>();

        }
        public ProductsViewModel(string categoryId = null)
        {
            _CategoryId = categoryId;

            _Products = new ObservableCollection<CatalogProduct>();

            _CatalogClient = DependencyService.Get<ICatalogDataClient>();

        }
Example #7
0
 public ChartDataService()
 {
     _CatalogClient = DependencyService.Get <ICatalogDataClient>();
 }
 public ChartDataService()
 {
     _CatalogClient = DependencyService.Get<ICatalogDataClient>();
 }