public DataTemplateSelectorGallery()
        {
            InitializeComponent();

            _demoFilteredItemSource = new DemoFilteredItemSource(filter: ItemMatches);

            CollectionView.ItemsSource = _demoFilteredItemSource.Items;

            SearchBar.SearchCommand = new Command(() =>
            {
                _demoFilteredItemSource.FilterItems(SearchBar.Text);
                CollectionView.EmptyView = SearchBar.Text;
            });
        }
Example #2
0
 void SearchBarOnTextChanged(object sender, TextChangedEventArgs e)
 {
     _demoFilteredItemSource.FilterItems(e.NewTextValue);
 }