Пример #1
0
        public static ContactPageViewModel Create(ContactPage currentPage)
        {
            var model = new ContactPageViewModel(currentPage);

            PageViewModelBuilder.SetBaseProperties(model);

            return(model);
        }
Пример #2
0
        public static ProductListPageViewModel Create(ProductListPage currentPage)
        {
            var model = new ProductListPageViewModel(currentPage);

            PageViewModelBuilder.SetBaseProperties(model);
            model.Products = FakeProductDatabase.GetProducts();
            return(model);
        }
Пример #3
0
        public static StartPageViewModel Create(StartPage currentPage)
        {
            var model = new StartPageViewModel(currentPage);

            PageViewModelBuilder.SetBaseProperties(model);
            model.LatestNews = GetLatestNews();
            return(model);
        }
Пример #4
0
        public static NewsListPageViewModel Create(NewsListPage currentPage, int page)
        {
            var model = new NewsListPageViewModel(currentPage);

            PageViewModelBuilder.SetBaseProperties(model);
            model.News        = new PagedList <NewsPage>(GetNews(currentPage), page, PageSize);
            model.NewsHolders = GetNewsHolders(currentPage);
            model.Page        = page;
            return(model);
        }
Пример #5
0
        public static NewsPageViewModel Create(NewsPage currentPage)
        {
            var model = new NewsPageViewModel(currentPage);

            PageViewModelBuilder.SetBaseProperties(model);

            model.RelatedNews = SearchManager.Instance.FindSimular(currentPage, 0, 5);

            return(model);
        }
Пример #6
0
        public static SearchPageViewModel Create(SearchPage currentPage, string query, int page)
        {
            var model = new SearchPageViewModel(currentPage);

            PageViewModelBuilder.SetBaseProperties(model);
            model.SearchResult = new PagedList <SearchHit>(GetSearchResult(currentPage, query, page), page, PageSize);
            model.Query        = query;
            model.Page         = page;
            return(model);
        }