private void eSearch_TextChanged(object sender, TextChangedEventArgs e) { try { var eSearch = (Entry)sender; string sSearch = eSearch.Text; if (sSearch == "") { return; } var ItemTapped = new TapGestureRecognizer(); ItemTapped.Tapped += ItemTapped_Tapped; stackList.Children.Clear(); mCollection = new ObservableCollection <RegKataItems>(kataPlay.GetRegSearchKata(sSearch)); foreach (RegKataItems data in mCollection) { var item = new MyKataCellView(data.KataKor, data.KataIndo, data.KataIndoTambah); item.GestureRecognizers.Add(ItemTapped); stackList.Children.Add(item); } mCollection.Clear(); SetbtnKataAddVisible(false); } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); } }
private void LoadAllKataData() { try { var ItemTapped = new TapGestureRecognizer(); ItemTapped.Tapped += ItemTapped_Tapped; stackList.Children.Clear(); mCollection = new ObservableCollection <RegKataItems>(kataPlay.GetRegItems()); foreach (RegKataItems data in mCollection) { var item = new MyKataCellView(data.KataKor, data.KataIndo, data.KataIndoTambah); item.GestureRecognizers.Add(ItemTapped); stackList.Children.Add(item); } mCollection.Clear(); } catch { } }