private static IElementFactory GetKeyDirectiveFactory(XamlElement element, Type keyType) { XamlMember keyDirective = element.Directives.FirstOrDefault(directive => directive.Name == XamlLanguage.KeyDirective); return(keyDirective != null?ElementFactory.FromValue(keyDirective.GetSingleValue(), keyType, element.Namespaces) : null); }
private static string GetNameDirectiveValue(XamlElement element) { XamlMember nameDirective = element.Directives.FirstOrDefault(directive => directive.Name == XamlLanguage.NameDirective); return(nameDirective != null ? (string)nameDirective.GetSingleValue() : null); }