Пример #1
0
        // GET: Place
        public ActionResult Index()
        {
            var model = new PlaceListViewModel();

            model.PageTitle = "List of places - Mowido";
            model.Header    = "List of places";
            model.Places    = _context.PlaceRepository.GetAll().ToList();
            return(View(model));
        }
Пример #2
0
        // GET: Place
        public IActionResult Index(int page = 1)
        {
            int pageSize = 3;
            var source   = _placeService.GetPlaces();
            var count    = source.Count;
            var items    = source.Skip((page - 1) * pageSize).Take(pageSize).ToList();

            PageViewModel      pageViewModel = new PageViewModel(count, page, pageSize);
            PlaceListViewModel viewModel     = new PlaceListViewModel
            {
                PageViewModel = pageViewModel,
                Places        = items
            };

            return(View(viewModel));
        }
Пример #3
0
        public PlaceListPage()
        {
            InitializeComponent();

            BindingContext = _viewModel = App.Current.Services.GetService <PlaceListViewModel>();
        }