public static bool IsPropertyOrFieldACollection(XElement propertyElement, ReflectionOnSeparateAppDomainHandler reflectionOnSeparateAppDomain, bool isAttachedProperty) { if (isAttachedProperty) { string methodName = "Get" + propertyElement.Name.LocalName.Split('.')[1]; // In case of attached property, we check the return type of the method "GetPROPERTYNAME()". For example, in case of "Grid.Row", we check the return type of the method "Grid.GetRow()". XName elementName = propertyElement.Name.Namespace + propertyElement.Name.LocalName.Split('.')[0]; // eg. if the propertyElement is <VisualStateManager.VisualStateGroups>, this will be "DefaultNamespace+VisualStateManager" string namespaceName, localName, assemblyNameIfAny; GetClrNamespaceAndLocalName(elementName, out namespaceName, out localName, out assemblyNameIfAny); return(reflectionOnSeparateAppDomain.DoesMethodReturnACollection(methodName, namespaceName, localName, assemblyNameIfAny)); } else { var propertyOrFieldName = propertyElement.Name.LocalName.Split('.')[1]; //todo: keep the full local name (propertyElement.Name.LocalName) and pass it to the reflectionOnSeparateAppDomain method for the cases of binding on attached properties --> it will be used to get the type of the attached property and the actual name of the property. var parentElement = propertyElement.Parent; string parentNamespaceName, parentLocalName, parentAssemblyNameIfAny; GetClrNamespaceAndLocalName(parentElement.Name, out parentNamespaceName, out parentLocalName, out parentAssemblyNameIfAny); return(reflectionOnSeparateAppDomain.IsPropertyOrFieldACollection(propertyOrFieldName, parentNamespaceName, parentLocalName, parentAssemblyNameIfAny)); } }