protected AbstractStyleKey(string name, bool inherited) { Name = name; Inherited = inherited; Type = typeof(T); StyleKeys.Add(this); }
private StyleContainer ToContainer(IStyleRule rule) { var container = new StyleContainer(rule.SelectorText); foreach (var property in rule.Style) { var propName = StringUtility.ToPascalCase(property.Name); if (StyleKeys.TryGetByName(propName, out var styleKey) && context.Converters.TryConvert(property.Value, styleKey.Type, out var propertyValue)) { styleKey.Set(container, propertyValue); } } return(container); }