예제 #1
0
        private static Window NewMainWindow(UserDetails user, IEnumerable <Grade> userGrades, string title)
        {
            // TODO: Make a builder or factory to do this more abstractly

            var view = new ViewBase();

            var currentPageVm = new DefaultPageViewModel(view)
            {
                UserDetails = user,
                UserGrades  = new ObservableCollection <Grade>(userGrades)
            };

            currentPageVm.GradesScatterChart.ParseData();

            var viewModel = new ViewModelBase(view)
            {
                CurrentPage = new DefaultPageView
                {
                    DataContext = currentPageVm
                },
                WindowTitle = title
            };

            view.DataContext = viewModel;

            return(view);
        }
예제 #2
0
        public ActionResult Index(StandardPage currentPage)
        {
            /* Implementation of action. You can create your own view model class that you pass to the view or
             * you can pass the page type for simpler templates */
            DefaultPageViewModel <StandardPage> model = new DefaultPageViewModel <StandardPage>(currentPage);

            return(View(model));
        }
        public ActionResult Index(FAQPage currentPage)
        {
            var contentRepository = ServiceLocator.Current.GetInstance <IContentRepository>();

            currentPage.FaqItems = contentRepository.GetChildren <FAQItem>(currentPage.ContentLink).ToList();
            DefaultPageViewModel <FAQPage> model = new DefaultPageViewModel <FAQPage>(currentPage);

            return(View(model));
        }
        public ActionResult Index(FAQPage currentPage)
        {
            /* Implementation of action. You can create your own view model class that you pass to the view or
             * you can pass the page type for simpler templates */
            var contentRepository = EPiServer.ServiceLocation.ServiceLocator.Current.GetInstance <IContentRepository>();

            currentPage.FAQItems = contentRepository.GetChildren <FAQItem>(currentPage.ContentLink).ToList();
            DefaultPageViewModel <FAQPage> model = new DefaultPageViewModel <FAQPage>(currentPage);

            return(View(model));
        }
예제 #5
0
        public ActionResult Index(ClothProductPage currentPage)
        {
            /* Implementation of action. You can create your own view model class that you pass to the view or
             * you can pass the page type for simpler templates */
            var clothes = new ClothProductPage();
            //clothes.ProductImage =

            var model = new DefaultPageViewModel <ClothProductPage>(currentPage);

            return(View(model));
        }
        public ViewResult Submit(FAQPage currentPage, string question)
        {
            var     contentRepository = ServiceLocator.Current.GetInstance <IContentRepository>();
            FAQItem fi = contentRepository.GetDefault <FAQItem>(currentPage.ContentLink);

            fi.Name     = string.Format("Question: {0}", question);
            fi.Question = question;

            contentRepository.Save(fi, EPiServer.DataAccess.SaveAction.Save, EPiServer.Security.AccessLevel.Read);
            DefaultPageViewModel <FAQPage> model = new DefaultPageViewModel <FAQPage>(currentPage);

            return(View("Index", model));
        }
예제 #7
0
        public ActionResult Index(StartPage currentPage)
        {
            /* Implementation of action. You can create your own view model class that you pass to the view or
             * you can pass the page type for simpler templates */

            DefaultPageViewModel <StartPage> model = new DefaultPageViewModel <StartPage>(currentPage);

            if (PageReference.IsNullOrEmpty(currentPage.SearchPageLink))
            {
                model.IsSearchPageSet        = false;
                model.SearchNotActiveMessage = _uiInfoSearchInactiveMessage;
            }
            return(View(model));
        }
예제 #8
0
        public ActionResult Index(ProductPage currentPage)
        {
            var viewmodel = new DefaultPageViewModel <ProductPage>(currentPage);

            return(View(viewmodel));
        }
예제 #9
0
        public override ActionResult Index(SitePageData currentPage)
        {
            var viewmodel = new DefaultPageViewModel <SitePageData>(currentPage);

            return(PartialView(SiteTags.Wide, viewmodel));
        }
예제 #10
0
        public ActionResult Index(StandardPage currentPage)
        {
            var viewmodel = new DefaultPageViewModel <StandardPage>(currentPage);

            return(View(viewmodel));
        }
        public ActionResult Index(StartPage currentPage)
        {
            DefaultPageViewModel <StartPage> model = new DefaultPageViewModel <StartPage>(currentPage);

            return(View(model));
        }
예제 #12
0
        public ActionResult Index(NewsLandingPage currentPage)
        {
            var viewmodel = new DefaultPageViewModel <NewsLandingPage>(currentPage);

            return(View(viewmodel));
        }