Ejemplo n.º 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 = "";
            }
        }
Ejemplo n.º 2
0
        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 = "";
            }
        }