Ejemplo n.º 1
0
        private void SearchBar_TextChanged(object sender, TextChangedEventArgs e)
        {
            try
            {
                if (e.NewTextValue == null)
                {
                    oHomeViewModel.FilterItemsName("");
                }
                else
                {
                    SearchBar searchBar = (SearchBar)sender;
                    if (searchBar.Text.Length >= 3)
                    {
                        //DisplayAlert("filtrar", "pelicula", "ok");
                        oHomeViewModel.FilterItemsName(searchBar.Text);
                    }
                    else
                    {
                        if (searchBar.Text.Length == 0)
                        {
                            //DisplayAlert("RESETEAR", "pelicula", "ok");
                            oHomeViewModel.FilterItemsName(searchBar.Text);
                        }
                    }
                }
            }
            catch {
            }

            carouselView.ScrollTo(2);
            carouselView2.ScrollTo(2);
            carouselView3.ScrollTo(2);
        }