Skip to content

List with or not pagination

Giuseppe Novielli edited this page Sep 18, 2022 · 1 revision
BaseListPaginationAdvancedViewModel<TCellVM, TItemsRoot, TItem> : BaseListPaginationViewModel
        where TCellVM : BaseCellViewModel<TItem>, new()
        where TItem : BaseItem, new()
        where TItemsRoot : BaseModelItemsRoot<TItem>, new()

You must inherit from the above class and specify:

  • TItem, the model that contains data
  • TCellVM, the cell ViewModel's class. This manage the cell's content. It could be also BaseCellViewModel<TItem> if you don't want to create a custom class.

Simply example:

public class PostPageViewModel : BaseListPaginationAdvancedViewModel
        <PostCellViewModel, BaseModelItemsRoot<PostItem>, PostItem>
    {
        public PostPageViewModel(
            INavigationService navigationService,
            IRequestService requestService) : base(navigationService, requestService)
        {
        }

//Define URL Endpoint
        public override string SetupEndpoint()
        {
            return Constants.Constants.METHOD_POST;
        }
    }

Clone this wiki locally