コード例 #1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            InventoryClient  inventoryClient = new InventoryClient();
            List <Inventory> inventory       = await inventoryClient.GetInventoryAsync();

            var trends = new ObservableCollection <Inventory>(inventory);

            InventoryList.ItemsSource = trends;
        }
コード例 #2
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            BindingContext = _bill;
            InventoryClient inventoryClient = new InventoryClient();

            Inventory = await inventoryClient.GetInventoryAsync();

            List <string> names = new List <string>();

            foreach (var item in Inventory)
            {
                string format = item.Name + " , " + item.Size;
                names.Add(format);
            }
            ItemsPicker.ItemsSource = names;
        }
コード例 #3
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            Bills            bill            = (Bills)BindingContext;
            List <Item>      items           = new List <Item>();
            InventoryClient  inventoryClient = new InventoryClient();
            List <Inventory> inventory       = await inventoryClient.GetInventoryAsync();

            foreach (var billItem in bill.Items)
            {
                foreach (var item in inventory)
                {
                    if (!item.Id.Equals(billItem.ItemId))
                    {
                        continue;
                    }
                    billItem.Name  = item.Name;
                    billItem.Type  = item.Type;
                    billItem.Size  = item.Size;
                    billItem.Price = item.Price;
                }
            }
            ItemsList.ItemsSource = bill.Items;
        }