コード例 #1
0
        private async Task Initialize()
        {
            PageTitle = "New Order - Products";
            var products = await stocklistService.GetProductListById(currentSubCategory.Id);

            Products = null;
            Products = new ObservableCollection <Product>(products);
            var orderList = await stocklistService.GetOrderList();

            OrderList = null;
            OrderList = new ObservableCollection <Order>(orderList);
        }
コード例 #2
0
        public StocklistProductViewModel(SubCategory subCategory, INavigation navigation, IStocklistService slService)
        {
            this.navigation         = navigation;
            this.currentSubCategory = subCategory;
            stocklistService        = slService;
            LoadFile();

            RefreshProducts();

            MessagingCenter.Subscribe(this, MessageNames.ProductSaved,
                                      async(StocklistEditProductViewModel sender, Product product) =>
            {
                Products = new ObservableCollection <Product>(await stocklistService.GetProductListById(currentSubCategory.Id));
            });
        }
コード例 #3
0
        private async Task RefreshProducts()
        {
            if (currentSubCategory != null)
            {
                PageTitle = "Overview Stocklist - " + currentSubCategory.Name;
                var products = await stocklistService.GetProductListById(currentSubCategory.Id);

                Products = null;
                Products = new ObservableCollection <Product>(products);
            }
            else
            {
                PageTitle                   = "New Subcategory List";
                currentSubCategory          = new SubCategory();
                currentSubCategory.Id       = Guid.NewGuid();
                currentSubCategory.Products = new List <Product>();
            }
            LoadProductState();
        }