public CustomTableViewSource(
            CellConfiguration <TItem> configureCell,
            HeaderConfiguration <THeader> configureHeader,
            IEnumerable <TSection> sections = null)
            : base(sections)
        {
            Ensure.Argument.IsNotNull(configureCell, nameof(configureCell));

            this.configureCell   = configureCell;
            this.configureHeader = configureHeader;
        }
Esempio n. 2
0
        public CustomTableViewSource(
            CellConfiguration <TItem> configureCell,
            HeaderConfiguration <THeader> configureHeader,
            IImmutableList <TItem> items = null)
            : base(items)
        {
            Ensure.Argument.IsNotNull(configureCell, nameof(configureCell));

            this.configureCell   = configureCell;
            this.configureHeader = configureHeader;
        }
Esempio n. 3
0
        public HeaderConfiguration GetHeaderConfiguration(IPublishedContent content = null)
        {
            HeaderConfiguration headerConfig = null;
            var branch = content?.AncestorsOrSelf().ToList();
            var index  = 0;


            if (branch != null)
            {
                do
                {
                    headerConfig = branch[index].HasValue(DocumentTypes.BasePage.Fields.HeaderConfiguration)
                        ? new HeaderConfiguration(branch[index].Value <IEnumerable <IPublishedElement> >(DocumentTypes.BasePage.Fields.HeaderConfiguration).FirstOrDefault()) : null;
                    index++;
                } while (index < branch.Count() && headerConfig == null);
            }



            if (headerConfig != null)
            {
                return new HeaderConfiguration(headerConfig)
                       {
                           NavigationItems = _navigationService.GetNavigation(),
                           Logo            = _imageService.GetImage(headerConfig.Value <IPublishedContent>(DocumentTypes.Configuration.Logo), height: 100),
                           Languages       = _localizationService.GetAllLanguages()
                                             .Where(l => !Equals(l.CultureInfo, CultureInfo.CurrentCulture))
                                             .Select(a => new Language()
                    {
                        Name = a.CultureInfo.NativeName.Split(' ')[0],
                        ISO  = a.CultureInfo.TwoLetterISOLanguageName
                    }),
                           GlobalSlogan = GetGlobalSlogan()
                       }
            }
            ;

            return(null);
        }