private async Task LoadProduct() { UserDialogs.Instance.ShowLoading("Laddar..."); var data = await AzureService.Instance.ProductManager.GetItemsAsync(true); ProductSource.Items = data; ProductCollectionView.ReloadData(); UserDialogs.Instance.HideLoading(); }
private async Task InitializeCollectionView() { UINib nib = UINib.FromName(ProductViewCell.Key, null); ProductCollectionView.RegisterNibForCell(nib, ProductViewCell.Key); //nib = UINib.FromName(SellArticleButtonViewCell.Key, null); //ProductCollectionView.RegisterNibForCell(nib, SellArticleButtonViewCell.Key); ProductSource = new ProductDataSource(); ProductSource.SellRequestedCallback = OnSellRequested; ProductSource.ProductelectedCallback = OnProductelected; ProductCollectionView.Source = ProductSource; //await ProductDataService.Instance.Initialize(); // As each item image download may occur after its cell is loaded, // we should reload it when that download is completed // ProductDataService.Instance.MobileService.EventManager // .Subscribe<FileDownloadedEvent>(file => //{ // ProductCollectionView.BeginInvokeOnMainThread(() => // { // var targetCell = ProductCollectionView.VisibleCells // .OfType<ProductViewCell>() // .FirstOrDefault(c => c.ItemId == file.Name); // if (targetCell != null) // { // NSIndexPath path = ProductCollectionView.IndexPathForCell(targetCell); // ProductCollectionView.ReloadItems(new[] { path }); // } // }); //}); }