예제 #1
0
 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);
 }
예제 #2
0
 public void SetValue(DependencyPropertyKey key, object value)
 {
     if (key == null)
         throw new ArgumentNullException("key");
     SetValueCore(key.Property, value);
 }
예제 #3
0
 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;
 }
예제 #4
0
 public void ClearValue(DependencyPropertyKey key)
 {
     if (key == null)
         throw new ArgumentNullException("key");
     ClearValueCore(key.Property);
 }