public static IGroupableItemsViewSource Create(GroupableItemsView itemsView, RecyclerView.Adapter adapter) { if (itemsView.IsGrouped) { return(new ObservableGroupedSource(itemsView, new AdapterNotifier(adapter))); } return(new UngroupedItemsSource(Create(itemsView.ItemsSource, adapter))); }
public ObservableGroupedSource(GroupableItemsView groupableItemsView, ICollectionChangedNotifier notifier) { var groupSource = groupableItemsView.ItemsSource; _notifier = notifier; _groupSource = groupSource as IList ?? new ListSource(groupSource); _hasGroupFooters = groupableItemsView.GroupFooterTemplate != null; _hasGroupHeaders = groupableItemsView.GroupHeaderTemplate != null; if (_groupSource is INotifyCollectionChanged incc) { incc.CollectionChanged += CollectionChanged; } UpdateGroupTracking(); }
public static void MapIsGrouped(GroupableItemsViewHandler <TItemsView> handler, GroupableItemsView itemsView) { }
public static void MapIsGrouped(GroupableItemsViewHandler <TItemsView> handler, GroupableItemsView itemsView) { handler.UpdateItemsSource(); }
public GroupableItemsViewController(GroupableItemsView groupableItemsView, ItemsViewLayout layout) : base(groupableItemsView, layout) { _isGrouped = GroupableItemsView.IsGrouped; }
public static GroupableItemsView GroupFooterTemplate(this GroupableItemsView items, DataTemplate template) { items.GroupFooterTemplate = template; return(items); }
public static GroupableItemsView IsGrouped(this GroupableItemsView items, bool isGrouped) { items.IsGrouped = isGrouped; return(items); }
public static GroupableItemsView GroupHeaderAndFooterTemplate(this GroupableItemsView items, DataTemplate headerTemplate, DataTemplate footerTemplate) { items.GroupHeaderTemplate = headerTemplate; items.FooterTemplate = footerTemplate; return(items); }