Example #1
0
        void MainSearchBar_TextChanged(System.Object sender, Xamarin.Forms.TextChangedEventArgs e)
        {
            var keyword = MainSearchBar.Text;

            if (keyword != null)
            {
                FolderListView.BeginRefresh();
                FolderListView.ItemsSource = MyList.Where(i => i.Files.ToLower().Contains(keyword.ToLower()));
                FolderListView.EndRefresh();
            }
            else
            {
                MainSearchBar.Text = "";
            }
        }
        void OnBtnPressed(object sender, EventArgs ea)
        {
            var keyword = MainSearchBar.Text;

            if (keyword != null)
            {
                FolderListView.BeginRefresh();
                FolderListView.ItemsSource = DependencyService.Get <ISQLite>().GetFolders().Where(i => i.Name.ToLower().Contains(keyword.ToLower()));
                FolderListView.EndRefresh();
            }
            else
            {
                MainSearchBar.Text = "";
            }
        }