public ViewResult CategoryView(string searchString, int?page) { ViewBag.SearchCategory = searchString; var categories = _categoryDataProvider.GetCategoriesBySearchString(searchString); var pageSize = 10; var pageNumber = (page ?? 1); var viewModel = new CategoryViewViewModel() { CategoryList = categories.ToPagedList(pageNumber, pageSize) }; return(View(viewModel)); }
public CategoryViewPage(CategoryViewViewModel viewModel) { InitializeComponent(); BindingContext = this.viewModel = viewModel; }