/// <summary>For use by XamlParser only.</summary> internal XamlObject(XamlDocument document, XmlElement element, Type elementType, object instance) { this.document = document; this.element = element; this.elementType = elementType; this.instance = instance; var contentAttrs = elementType.GetCustomAttributes(typeof(ContentPropertyAttribute), true) as ContentPropertyAttribute[]; if (contentAttrs != null && contentAttrs.Length > 0) { this.contentPropertyName = contentAttrs[0].Name; } ServiceProvider = new XamlObjectServiceProvider(this); CreateWrapper(); }
/// <summary>For use by XamlParser only.</summary> internal XamlObject(XamlDocument document, XmlElement element, Type elementType, object instance) { this.document = document; this.element = element; this.elementType = elementType; this.instance = instance; this.contentPropertyName = GetContentPropertyName(elementType); ServiceProvider = new XamlObjectServiceProvider(this); CreateWrapper(); var rnpAttrs = elementType.GetCustomAttributes(typeof(RuntimeNamePropertyAttribute), true) as RuntimeNamePropertyAttribute[]; if (rnpAttrs != null && rnpAttrs.Length > 0 && !String.IsNullOrEmpty(rnpAttrs[0].Name)) { runtimeNameProperty = rnpAttrs[0].Name; } }