Example #1
0
        public async Task <ActionResult> Index()
        {
            var model = new ThemeViewModel
            {
                Themes = await _themeService.GetAsync(),
                Fonts  = await _fontService.GetAsync()
            };

            return(View(model));
        }
        public async Task <ActionResult> Edit(int themeId)
        {
            var theme = await _themeService.GetAsync(themeId);

            if (theme == null)
            {
                throw new ArgumentException($"Unable to Identify Theme: {themeId}");
            }

            var model = new UpsertViewModel
            {
                ThemeId              = themeId,
                ThemeName            = theme.ThemeName,
                TextFontId           = theme.TextFontId.Value,
                TitleFontId          = theme.TitleFontId.Value,
                FontList             = await _fontService.GetAsync(),
                LargeTitleFontSize   = theme.TitleLargeFontSize,
                MediumTitleFontSize  = theme.TitleMediumFontSize,
                SmallTitleFontSize   = theme.TitleSmallFontSize,
                TinyTitleFontSize    = theme.TitleTinyFontSize,
                TextStandardFontSize = theme.TextStandardFontSize,
                PageBackgroundColour = theme.PageBackgroundColour,
                MenuBackgroundColour = theme.MenuBackgroundColour,
                MenuTextColour       = theme.MenuTextColour,
                IsDefault            = theme.IsDefault
            };

            return(PartialView("_Edit", model));
        }
        public async Task <ActionResult> Index()
        {
            var model = new AppDrawerViewModel
            {
                Themes = await _themeService.GetAsync(),
                Fonts  = new List <Entities.Entities.Font>()
            };

            model.Fonts.AddRange(model.Themes.Select(x => x.TextFont));
            model.Fonts.AddRange(model.Themes.Select(x => x.TitleFont));

            return(View(model));
        }