public Theme(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)); } AddLibraryTheme(libraryTheme); }
public Theme AddLibraryTheme(LibraryTheme libraryTheme) { var theme = GetTheme(libraryTheme.Name, libraryTheme.IsHighContrast); if (theme is not null) { theme.AddLibraryTheme(libraryTheme); return(theme); } theme = new Theme(libraryTheme); themesInternal.Add(theme); return(theme); }
public Theme AddLibraryTheme(LibraryTheme libraryTheme) { if (libraryTheme is null) { throw new ArgumentNullException(nameof(libraryTheme)); } if (libraryTheme.ParentTheme is not null) { throw new ArgumentException("The theme already has a parent."); } if (LibraryThemesInternal.Contains(libraryTheme) == false) { LibraryThemesInternal.Add(libraryTheme); libraryTheme.ParentTheme = this; Resources.MergedDictionaries.Add(libraryTheme.Resources); } return(this); }
public virtual bool MatchesThirdTry(LibraryTheme libraryTheme) { return(BaseColorScheme == libraryTheme.BaseColorScheme && ShowcaseBrush.ToString() == libraryTheme.ShowcaseBrush.ToString() && IsHighContrast == libraryTheme.IsHighContrast); }
public virtual bool MatchesSecondTry(LibraryTheme libraryTheme) { return(BaseColorScheme == libraryTheme.BaseColorScheme && AlternativeColorScheme == libraryTheme.ColorScheme && IsHighContrast == libraryTheme.IsHighContrast); }
public virtual bool Matches(LibraryTheme libraryTheme) { return(BaseColorScheme == libraryTheme.BaseColorScheme && ColorScheme == libraryTheme.ColorScheme && IsHighContrast == libraryTheme.IsHighContrast); }