public Theme([NotNull] LibraryTheme libraryTheme) : this(libraryTheme.Name, libraryTheme.DisplayName, libraryTheme.BaseColorScheme, libraryTheme.ColorScheme, libraryTheme.PrimaryAccentColor, libraryTheme.ShowcaseBrush, libraryTheme.IsRuntimeGenerated, libraryTheme.IsHighContrast) { if (libraryTheme is null) { throw new ArgumentNullException(nameof(libraryTheme)); } this.AddLibraryTheme(libraryTheme); }
public Theme AddLibraryTheme(LibraryTheme libraryTheme) { var theme = this.GetTheme(libraryTheme.Name, libraryTheme.IsHighContrast); if (theme is not null) { theme.AddLibraryTheme(libraryTheme); return(theme); } theme = new Theme(libraryTheme); this.themesInternal.Add(theme); return(theme); }
public Theme AddLibraryTheme([NotNull] LibraryTheme libraryTheme) { if (libraryTheme is null) { throw new ArgumentNullException(nameof(libraryTheme)); } if (!(libraryTheme.ParentTheme is null)) { throw new ArgumentException("The theme already has a parent."); } if (this.LibraryThemesInternal.Contains(libraryTheme) == false) { this.LibraryThemesInternal.Add(libraryTheme); libraryTheme.ParentTheme = this; this.Resources.MergedDictionaries.Add(libraryTheme.Resources); } return(this); }
public virtual bool MatchesThirdTry(LibraryTheme libraryTheme) { return(this.BaseColorScheme == libraryTheme.BaseColorScheme && this.ShowcaseBrush.ToString() == libraryTheme.ShowcaseBrush.ToString() && this.IsHighContrast == libraryTheme.IsHighContrast); }
public virtual bool MatchesSecondTry(LibraryTheme libraryTheme) { return(this.BaseColorScheme == libraryTheme.BaseColorScheme && this.AlternativeColorScheme == libraryTheme.ColorScheme && this.IsHighContrast == libraryTheme.IsHighContrast); }
public virtual bool Matches(LibraryTheme libraryTheme) { return(this.BaseColorScheme == libraryTheme.BaseColorScheme && this.ColorScheme == libraryTheme.ColorScheme && this.IsHighContrast == libraryTheme.IsHighContrast); }