Пример #1
0
        public PageViewModel(
            IPageConfiguration pageConfiguration,
            LanguageDefinition language,
            ContentViewModel contentViewModel,
            ContentLinksViewModel contentLinksViewModel)
        {
            if (pageConfiguration == null)
            {
                throw new ArgumentNullException(nameof(pageConfiguration));
            }

            if (contentViewModel == null)
            {
                throw new ArgumentNullException(nameof(contentViewModel));
            }

            if (contentLinksViewModel == null)
            {
                throw new ArgumentNullException(nameof(contentLinksViewModel));
            }

            _pageConfiguration    = pageConfiguration;
            Language              = language;
            ContentViewModel      = contentViewModel;
            ContentLinksViewModel = contentLinksViewModel;
        }
Пример #2
0
        public PageViewModel(
            IPageConfiguration pageConfiguration,
            LanguageDefinition language,
            ContentViewModel contentViewModel,
            ContentLinksViewModel contentLinksViewModel)
        {
            if(pageConfiguration == null)
            {
                throw new ArgumentNullException(nameof(pageConfiguration));
            }

            if (contentViewModel == null)
            {
                throw new ArgumentNullException(nameof(contentViewModel));
            }

            if(contentLinksViewModel == null)
            {
                throw new ArgumentNullException(nameof(contentLinksViewModel));
            }

            _pageConfiguration = pageConfiguration;
            Language = language;
            ContentViewModel = contentViewModel;
            ContentLinksViewModel = contentLinksViewModel;
        }
Пример #3
0
        /// <summary>
        /// Create <see cref="PageViewModel"/>.
        /// </summary>
        /// <param name="pageConfiguration">Page configuration.</param>
        /// <param name="language">Language.</param>
        /// <param name="contentPublicViewData">Content view data.</param>
        /// <param name="contentPublicLinksData">Content links data.</param>
        public PageViewModel(
            IPageConfiguration pageConfiguration,
            LanguageDefinition language,
            ContentPublicViewData contentPublicViewData,
            ContentPublicLinksData contentPublicLinksData)
        {
            if (contentPublicViewData == null)
            {
                throw new ArgumentNullException(nameof(contentPublicViewData));
            }

            if (contentPublicLinksData == null)
            {
                throw new ArgumentNullException(nameof(contentPublicLinksData));
            }

            _pageConfiguration    = pageConfiguration ?? throw new ArgumentNullException(nameof(pageConfiguration));
            Language              = language;
            ContentViewModel      = new ContentViewModel(contentPublicViewData);
            ContentLinksViewModel = new ContentLinksViewModel(contentPublicLinksData);
        }