public async Task UpdateViewModel() { IsLoading = true; ResultItems = await exampleService.GetItems(); Debug.WriteLine(ResultItems[0].channel); foreach (var item in ResultItems) { CollectionItems.Add(item); } Debug.WriteLine(CollectionItems[0].channel); IsLoading = false; }
private async Task LoadData(string sortBy) { LoaderState.ToBusy(); SortOnCode = sortBy == "Code"; SortOnGenus = sortBy == "Genus"; OnPropertyChanged(nameof(SortOnCode)); OnPropertyChanged(nameof(SortOnGenus)); var items = await _viewProvider.GetCollectionItemsAsync(sortBy); CollectionItems.Clear(); foreach (var item in items) { CollectionItems.Add(new CollectionItemViewModel(item)); } LoaderState.ToIdle(); }