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

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