コード例 #1
0
 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);
     }
 }
コード例 #2
0
        private void OnItemUnfocused(object sender, GenGridItemEventArgs e)
        {
            GengridItemContext context = e.Item.Data as GengridItemContext;

            Element.SendItemFocused(new GridViewItemFocusedEventArgs(context.Data, context.RealizedView, false));
        }
コード例 #3
0
        void OnItemSelected(object sender, GenGridItemEventArgs e)
        {
            GengridItemContext context = e.Item.Data as GengridItemContext;

            Element.SelectedItem = context.Data;
        }