void UpdateItemsSource() { _genGrid.Clear(); itemContexts.Clear(); foreach (var item in Element.ItemsSource) { View realview = CreateContent(Element.ItemTemplate, item); realview.BindingContext = item; var context = new GengridItemContext { Data = item, RealizedView = realview as View, }; itemContexts.Add(context); var gridItem = _genGrid.Append(gridItemClass, context); } }
private void OnItemUnfocused(object sender, GenGridItemEventArgs e) { GengridItemContext context = e.Item.Data as GengridItemContext; Element.SendItemFocused(new GridViewItemFocusedEventArgs(context.Data, context.RealizedView, false)); }
void OnItemSelected(object sender, GenGridItemEventArgs e) { GengridItemContext context = e.Item.Data as GengridItemContext; Element.SelectedItem = context.Data; }