Ejemplo n.º 1
0
#pragma warning disable CA1801 // Review unused parameters
        public BaseColorSchemeSwitcherWithIconViewModel(IServiceLocator serviceLocator, IBaseColorSchemeService baseColorSchemeService)
#pragma warning restore CA1801 // Review unused parameters
        {
            Argument.IsNotNull(() => serviceLocator);
            Argument.IsNotNull(() => baseColorSchemeService);

            _serviceLocator         = serviceLocator;
            _baseColorSchemeService = baseColorSchemeService;

            var baseColorSchemes = new List <BaseColorScheme>();

            foreach (var baseColorSchemeFromService in _baseColorSchemeService.GetAvailableBaseColorSchemes())
            {
                var baseColorScheme = new BaseColorScheme
                {
                    Name     = baseColorSchemeFromService,
                    ImageUri = $"/Orc.Theming;component/Resources/Images/BaseColor_{baseColorSchemeFromService}.png"
                };

                baseColorSchemes.Add(baseColorScheme);
            }

            BaseColorSchemes = baseColorSchemes;

            var selected = _baseColorSchemeService.GetBaseColorScheme() ?? BaseColorSchemes[0].Name;

            SelectedBaseColorScheme = BaseColorSchemes.FirstOrDefault(x => x.Name == selected);
        }
Ejemplo n.º 2
0
        public ThemeService(IAccentColorService accentColorService, IBaseColorSchemeService baseColorSchemeService)
        {
            Argument.IsNotNull(() => accentColorService);
            Argument.IsNotNull(() => baseColorSchemeService);

            _accentColorService     = accentColorService;
            _baseColorSchemeService = baseColorSchemeService;
        }
Ejemplo n.º 3
0
        public ThemeImage()
        {
            var serviceLocator = ServiceLocator.Default;

            _baseColorSchemeService = serviceLocator.TryResolveType <IBaseColorSchemeService>();

            Loaded   += OnLoaded;
            Unloaded += OnUnloaded;
        }
#pragma warning disable CA1801 // Review unused parameters
        public BaseColorSchemeSwitcherViewModel(IBaseColorSchemeService baseColorSchemeService)
#pragma warning restore CA1801 // Review unused parameters
        {
            Argument.IsNotNull(() => baseColorSchemeService);

            _baseColorSchemeService = baseColorSchemeService;

            BaseColorSchemes        = _baseColorSchemeService.GetAvailableBaseColorSchemes();
            SelectedBaseColorScheme = _baseColorSchemeService.GetBaseColorScheme() ?? BaseColorSchemes[0];
        }
        public FluentRibbonShellTheme(Orc.Controls.Services.IAccentColorService accentColorService,
                                      IThemeService themeService, IBaseColorSchemeService baseColorSchemeService)
        {
            Argument.IsNotNull(() => accentColorService);
            Argument.IsNotNull(() => themeService);

            _accentColorService     = accentColorService;
            _themeService           = themeService;
            _baseColorSchemeService = baseColorSchemeService;
            _accentColorService.AccentColorChanged         += OnAccentBaseSchemeColorChanged;
            _baseColorSchemeService.BaseColorSchemeChanged += OnAccentBaseSchemeColorChanged;
        }
Ejemplo n.º 6
0
        public ThemeManager(IAccentColorService accentColorService, IBaseColorSchemeService baseColorSchemeService)
        {
            Argument.IsNotNull(() => accentColorService);
            Argument.IsNotNull(() => baseColorSchemeService);

            _accentColorService     = accentColorService;
            _baseColorSchemeService = baseColorSchemeService;
            _themeManager           = ControlzEx.Theming.ThemeManager.Current;

            _accentColorService.AccentColorChanged         += OnAccentColorChanged;
            _baseColorSchemeService.BaseColorSchemeChanged += OnBaseColorSchemeChanged;
        }
Ejemplo n.º 7
0
        public ControlsViewModel(Orc.Controls.Services.IAccentColorService accentColorService, IBaseColorSchemeService baseColorSchemeService)
        {
            Argument.IsNotNull(() => accentColorService);
            Argument.IsNotNull(() => baseColorSchemeService);

            _accentColorService     = accentColorService;
            _baseColorSchemeService = baseColorSchemeService;

            AccentColors        = typeof(Colors).GetPropertiesEx(true, true).Where(x => x.PropertyType.IsAssignableFromEx(typeof(Color))).Select(x => (Color)x.GetValue(null)).ToList();
            SelectedAccentColor = Colors.Orange;

            BaseColorSchemes        = _baseColorSchemeService.GetAvailableBaseColorSchemes();
            SelectedBaseColorScheme = BaseColorSchemes[0];
        }
Ejemplo n.º 8
0
        public ThemeManager(ControlzEx.Theming.ThemeManager controlzThemeManager, IAccentColorService accentColorService, IBaseColorSchemeService baseColorSchemeService)
        {
            Argument.IsNotNull(() => controlzThemeManager);
            Argument.IsNotNull(() => accentColorService);
            Argument.IsNotNull(() => baseColorSchemeService);

            _accentColorService     = accentColorService;
            _baseColorSchemeService = baseColorSchemeService;
            _controlzThemeManager   = controlzThemeManager;

            _controlzThemeManager.ThemeChanged             += OnThemeManagerThemeChanged;
            _accentColorService.AccentColorChanged         += OnAccentColorChanged;
            _baseColorSchemeService.BaseColorSchemeChanged += OnBaseColorSchemeChanged;
        }
Ejemplo n.º 9
0
        public ThemeSwitcherViewModel(IAccentColorService accentColorService, IBaseColorSchemeService baseColorSchemeService)
        {
            Argument.IsNotNull(() => accentColorService);
            Argument.IsNotNull(() => baseColorSchemeService);

            _accentColorService     = accentColorService;
            _baseColorSchemeService = baseColorSchemeService;

            AccentColors = typeof(Colors).GetPropertiesEx(true, true)
                           .Where(x => x.PropertyType.IsAssignableFromEx(typeof(Color)))
                           .Select(x => (Color)x.GetValue(null))
                           .ToList();

            BaseColorSchemes        = _baseColorSchemeService.GetAvailableBaseColorSchemes();
            SelectedBaseColorScheme = _baseColorSchemeService.GetBaseColorScheme() ?? BaseColorSchemes[0];
        }
 public MaterialDesignThemeService(IAccentColorService accentColorService, IBaseColorSchemeService baseColorSchemeService)
     : base(accentColorService, baseColorSchemeService)
 {
 }