private void Sbr_books_TextChanged(object sender, TextChangedEventArgs e) { LV_bklst.BeginRefresh(); if (string.IsNullOrWhiteSpace(e.NewTextValue)) { LV_bklst.ItemsSource = App._booklist; } else { LV_bklst.ItemsSource = App._booklist.Where(b => (b.Title.ToLower().Contains(e.NewTextValue.ToLower())) | (b.Author.ToLower().Contains(e.NewTextValue.ToLower()))); } LV_bklst.EndRefresh(); }
private void Btn_brwdlst_Clicked(object sender, EventArgs e) { LV_bklst.BeginRefresh(); if (Btn_brwdlst.Text == "Borrowed books") { LV_bklst.ItemsSource = App._booklist.Where(b => (b.Availability.ToLower().Contains("no"))); Btn_brwdlst.Text = "Show all books"; Btn_duelst.IsVisible = false; Sbr_books.IsVisible = false; Lbl_comment.IsVisible = true; Lbl_comment.Text = "List of borrowed books:"; } else { LV_bklst.ItemsSource = App._booklist; Btn_brwdlst.Text = "Borrowed books"; Btn_duelst.IsVisible = true; Sbr_books.IsVisible = true; Lbl_comment.IsVisible = false; } LV_bklst.EndRefresh(); }