Esempio n. 1
0
 private MainNavigationViewModel GetNavigation(IFramePage model)
 {
     return(new MainNavigationViewModel()
     {
         Items = _navigationItemService.GetViewModels <MainNavigationItemViewModel>(model.Navigation),
         HasPageHero = false
     });
 }
 protected T CreateViewModel <T>(ISidebarComposition composition) where T : BasicSidebarViewModel, new()
 {
     return(new T
     {
         PrimaryCallToActionButton = _navigationItemService.GetViewModel(composition.SidebarPrimaryCallToActionButton),
         DataHubLinks = GetDataHubLinks(composition),
         SeeAlsoLinks = _navigationItemService.GetViewModels(composition.SidebarSeeAlsoLinks)
     });
 }
        private IEnumerable <NavigationItemViewModel> GetCategories(ScienceDetailsPage model)
        {
            var categories = _sciencePageCategoriesProvider.GetCategories(model);

            if (ExistenceUtility.IsNullOrEmpty(categories))
            {
                return(Enumerable.Empty <NavigationItemViewModel>());
            }

            return(_navigationItemService.GetViewModels(categories));
        }
        public IEnumerable <CategorisedFooterLinksViewModel> GetViewModels(IEnumerable <CategorisedFooterLinksSchema> schemas)
        {
            var viewModels = new List <CategorisedFooterLinksViewModel>();

            if (schemas == null)
            {
                return(viewModels);
            }

            foreach (var schema in schemas)
            {
                var categoryViewModel = new CategorisedFooterLinksViewModel()
                {
                    Heading = schema.Heading,
                    Links   = _navigationItemService.GetViewModels(schema.Links)
                };

                viewModels.Add(categoryViewModel);
            }

            return(viewModels);
        }