public DataTemplateSelectorGallery() { InitializeComponent(); _demoFilteredItemSource = new DemoFilteredItemSource(filter: ItemMatches); CollectionView.ItemsSource = _demoFilteredItemSource.Items; SearchBar.SearchCommand = new Command(() => { _demoFilteredItemSource.FilterItems(SearchBar.Text); CollectionView.EmptyView = SearchBar.Text; }); }
void SearchBarOnTextChanged(object sender, TextChangedEventArgs e) { _demoFilteredItemSource.FilterItems(e.NewTextValue); }