public Shell(ILocalizationService manager, IUIColorsViewModel vm, ShellViewModel datacontext) : base(manager, vm) { DataContext = datacontext ?? throw new ArgumentNullException(nameof(datacontext)); _datacontext = datacontext; InitializeComponent(); }
private static void ApplyAccent(IUIColorsViewModel vm, Swatch swatch) { if (swatch == null) { return; } _paletteHelper.ReplaceAccentColor(swatch); _accent = swatch.Name; }
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; }
public OptionsViewModel(IUIColorsViewModel colors, ICultureViewModel culture) { UIColorsViewModel = colors ?? throw new ArgumentNullException(nameof(colors)); CultureViewModel = culture ?? throw new ArgumentNullException(nameof(culture)); }
private static void ApplyBase(IUIColorsViewModel vm, bool isDark = false) { _paletteHelper.SetLightDark(isDark); _isDark = isDark; }
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}"); }
/// <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; }