示例#1
0
 public static void SetProperty(object instance, AttachableMemberIdentifier name, object value)
 {
     if (instance != null)
     {
         if (name == null)
         {
             throw new ArgumentNullException("name");
         }
         IAttachedPropertyStore store = instance as IAttachedPropertyStore;
         if (store != null)
         {
             store.SetProperty(name, value);
         }
         else
         {
             attachedProperties.SetProperty(instance, name, value);
         }
     }
 }
示例#2
0
        public static void SetProperty(object instance, AttachableMemberIdentifier name, object value)
        {
            if (instance == null)
            {
                return;
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            IAttachedPropertyStore ap = instance as IAttachedPropertyStore;

            if (ap != null)
            {
                ap.SetProperty(name, value);
                return;
            }

            attachedProperties.SetProperty(instance, name, value);
        }
 public static void SetSound(IAttachedPropertyStore element, int value)
 {
     element.SetProperty(SoundProperty, value);
 }
示例#4
0
 public static void SetVersion(IAttachedPropertyStore element, decimal value)
 {
     element.SetProperty(VersionProperty, value);
 }