private async Task UpdateVideos() { var data = Customer.GetCustomerList(100); _collectionView = new XuniGroupedCollectionView <string, Customer>(c => c.Country); //grid.ItemsSource = _collectionView; await _collectionView.SetSourceAsync(data); grid.ItemsSource = _collectionView; // iOS needs this to be called after SetSourceAsync _collectionView.SortChanged += OnSortChanged; UpdateSortButton(); }
private async Task UpdateVideos() { try { message.IsVisible = false; list.IsVisible = false; activityIndicator.IsRunning = true; _videos = new ObservableCollection <YouTubeVideo>((await YouTubeCollectionView.LoadVideosAsync("Xamarin Forms", "relevance", null, 50)).Item2); _collectionView = new XuniGroupedCollectionView <string, YouTubeVideo>(_videos, v => v.ChannelTitle); list.ItemsSource = _collectionView; list.IsVisible = true; } catch { message.Text = AppResources.InternetConnectionError; message.IsVisible = true; } finally { activityIndicator.IsRunning = false; } }