public async void GetItems() { string queryParam = "PLZCHH_4VqpRjpQP36-XM1jb1E_JIxJZFJ"; YouTubeQueryType queryType = YouTubeQueryType.Playlist; int maxRecordsParam = 20; YouTubeSearchOrderBy orderBy = YouTubeSearchOrderBy.None; InitializeDataProvider(); this.Items = new ObservableCollection <object>(); var config = new YouTubeDataConfig { Query = queryParam, QueryType = queryType, SearchVideosOrderBy = orderBy }; var items = await _youTubeDataProvider.LoadDataAsync(config, maxRecordsParam); foreach (var item in items) { Items.Add(item); } }
public async void GetItems() { string apiKey = "YourApiKey"; string queryParam = "PLZCHH_4VqpRjpQP36-XM1jb1E_JIxJZFJ"; YouTubeQueryType queryType = YouTubeQueryType.Playlist; int maxRecordsParam = 20; this.Items = new ObservableCollection <object>(); var _youTubeDataProvider = new YouTubeDataProvider(new YouTubeOAuthTokens { ApiKey = apiKey }); var config = new YouTubeDataConfig { Query = queryParam, QueryType = queryType }; var items = await _youTubeDataProvider.LoadDataAsync(config, maxRecordsParam); foreach (var item in items) { Items.Add(item); } }