示例#1
0
 private static PropertyReferenceCollection GetPropertyReferenceCollection(object target)
 {
     if (!AttachablePropertyServices.TryGetProperty(target, propertyReferencesPropertyID, out PropertyReferenceCollection propertyReferences))
     {
         propertyReferences = new PropertyReferenceCollection(target);
         AttachablePropertyServices.SetProperty(target, propertyReferencesPropertyID, propertyReferences);
     }
     return(propertyReferences);
 }
示例#2
0
        public static bool ShouldSerializePropertyReferences(object target)
        {
            PropertyReferenceCollection propertyReferences = GetPropertyReferenceCollection(target);

            return(propertyReferences.Count > 1 || propertyReferences.SingleItem == null);
        }