Beispiel #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);
 }
Beispiel #2
0
        public static bool ShouldSerializePropertyReferences(object target)
        {
            PropertyReferenceCollection propertyReferences = GetPropertyReferenceCollection(target);

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