Exemplo n.º 1
0
        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)));
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 public static void MapIsGrouped(GroupableItemsViewHandler <TItemsView> handler, GroupableItemsView itemsView)
 {
 }
 public static void MapIsGrouped(GroupableItemsViewHandler <TItemsView> handler, GroupableItemsView itemsView)
 {
     handler.UpdateItemsSource();
 }
Exemplo n.º 5
0
 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);
 }