Ejemplo n.º 1
0
        public Shell(ILocalizationService manager, IUIColorsViewModel vm, ShellViewModel datacontext) : base(manager, vm)
        {
            DataContext  = datacontext ?? throw new ArgumentNullException(nameof(datacontext));
            _datacontext = datacontext;

            InitializeComponent();
        }
Ejemplo n.º 2
0
        private static void ApplyAccent(IUIColorsViewModel vm, Swatch swatch)
        {
            if (swatch == null)
            {
                return;
            }

            _paletteHelper.ReplaceAccentColor(swatch);
            _accent = swatch.Name;
        }
Ejemplo n.º 3
0
        private static void ApplyPrimary(IUIColorsViewModel vm, Swatch swatch)
        {
            if (swatch == null)
            {
                return;
            }

            var oldPalette = _paletteHelper.QueryPalette();

            _paletteHelper.ReplacePrimaryColor(swatch);
            var newPalette = _paletteHelper.QueryPalette();

            if (newPalette.PrimarySwatch.Name != oldPalette.PrimarySwatch.Name)
            {
                vm.OnPrimaryColorChanged(new UiPrimaryColorChangedMessage(vm, newPalette.PrimarySwatch.ExemplarHue.Color));
            }

            _swatch = swatch.Name;
        }
Ejemplo n.º 4
0
 public OptionsViewModel(IUIColorsViewModel colors, ICultureViewModel culture)
 {
     UIColorsViewModel = colors ?? throw new ArgumentNullException(nameof(colors));
     CultureViewModel  = culture ?? throw new ArgumentNullException(nameof(culture));
 }
Ejemplo n.º 5
0
 private static void ApplyBase(IUIColorsViewModel vm, bool isDark = false)
 {
     _paletteHelper.SetLightDark(isDark);
     _isDark = isDark;
 }
Ejemplo n.º 6
0
 public OptionsViewModel(IUIColorsViewModel colors, ICultureViewModel culture)
 {
     UIColorsViewModel = colors ?? throw new ArgumentNullException(nameof(colors), $"{nameof(colors)} {Resources.IsRequired}");
     CultureViewModel  = culture ?? throw new ArgumentNullException(nameof(culture), $"{nameof(culture)} {Resources.IsRequired}");
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IoCWindow"/> class.
 /// </summary>
 /// <param name="container">The container.</param>
 /// <param name="vm">The vm.</param>
 public IoCWindow(ILocalizationService container, IUIColorsViewModel vm) : base()
 {
     TranslationManager = container;
     _colorsViewModel   = vm;
     _colorsViewModel.PrimaryColorChanged += PrimaryColorChanged;
 }