public void OverrideMetadata(Type forType, PropertyMetadata typeMetadata, DependencyPropertyKey key)
 {
     if (forType == null)
         throw new ArgumentNullException("forType");
     if (typeMetadata == null)
         throw new ArgumentNullException("typeMetadata");
     if (key == null)
         throw new ArgumentNullException("key");
     if (key.Property != this)
         throw new InvalidOperationException("Readonly property key not authorized.");
     OverrideMetadataCore(forType, typeMetadata);
 }
Esempio n. 2
0
 public void SetValue(DependencyPropertyKey key, object value)
 {
     if (key == null)
         throw new ArgumentNullException("key");
     SetValueCore(key.Property, value);
 }
 public static DependencyPropertyKey RegisterReadOnly(string name, Type propertyType, Type ownerType, PropertyMetadata typeMetadata, ValidateValueCallback validateValueCallback)
 {
     DependencyProperty dp = Register(name, propertyType, ownerType, typeMetadata, validateValueCallback);
     dp.ReadOnly = true;
     DependencyPropertyKey key = new DependencyPropertyKey(dp);
     return key;
 }
Esempio n. 4
0
 public void ClearValue(DependencyPropertyKey key)
 {
     if (key == null)
         throw new ArgumentNullException("key");
     ClearValueCore(key.Property);
 }