/// <summary> /// Initializes a new instance. /// </summary> /// <param name="style">The ResourceDictionary of the theme.</param> public Theme(IStyle style) { this.ThemeStyle = style ?? throw new ArgumentNullException(nameof(style)); object result; style.TryGetResource(ThemeNameKey, out result); this.Name = (string)result; style.TryGetResource(ThemeDisplayNameKey, out result); this.DisplayName = (string)result; style.TryGetResource(ThemeBaseColorSchemeKey, out result); this.BaseColorScheme = (string)result; style.TryGetResource(ThemeColorSchemeKey, out result); this.ColorScheme = (string)result; style.TryGetResource(ThemeShowcaseBrushKey, out result); this.ShowcaseBrush = (SolidColorBrush)result; }