private void OnSearch(Object sender, TextChangedEventArgs e) { var list = HymnDataAccess.Instance().GetList(); if (string.IsNullOrEmpty(e.NewTextValue)) { ((HymnListModel)BindingContext).Items = list; return; } temp.Clear(); temp = null; temp = new ObservableCollection <Hymn>(); for (int i = 0; i < list.Count; i++) { if (Matcher.Match(list[i].Title, e.NewTextValue) || list[i].Number.ToString().Contains(e.NewTextValue)) { temp.Add(new Hymn() { Number = list[i].Number, Title = list[i].Title, Page = list[i].Page }); } } ((HymnListModel)BindingContext).Items = temp; }
private void ItemClick(int page) { string category = HymnDataAccess.Instance().GetCategory(); string fileName = HymnDataAccess.Instance().GetFileName(); DependencyService.Get <IAudio>().Close(); DependencyService.Get <INativePage>().StartPage(category, fileName, page.ToString()); }