private async void OnDynamicFiltering(object sender, AutoCompleteFilteringEventArgs e) { var autoComplete = sender as C1AutoComplete; var deferal = e.GetDeferral(); try { var collectionView = new YouTubeCollectionView(); await collectionView.SearchAsync(e.FilterString); autoComplete.ItemsSource = collectionView; e.Cancel = true; } finally { deferal.Complete(); } }
private async void OnDynamicFiltering(object sender, AutoCompleteFilteringEventArgs e) { var autoComplete = sender as C1AutoComplete; var deferal = e.GetDeferral(); try { var collectionView = new YouTubeDataCollection(); await collectionView.SearchAsync(e.FilterString); autoComplete.SelectedIndex = -1; autoComplete.ItemsSource = collectionView; e.Cancel = true; } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { deferal.Complete(); } }