public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, ValidateValueCallback validateValueCallback) { ValidateRegisterParameters(name, propertyType, ownerType); var dp = new DependencyProperty(true, name, propertyType, ownerType, defaultMetadata, validateValueCallback); DependencyObject.Register(ownerType, dp); return(dp); }
public static DependencyProperty Register(string name, Type propertyType, Type ownerType, PropertyMetadata typeMetadata, ValidateValueCallback validateValueCallback) { ValidateRegisterParameters(name, propertyType, ownerType); var dp = new DependencyProperty(false, name, propertyType, ownerType, typeMetadata, validateValueCallback); DependencyObject.Register(ownerType, dp); // is this needed? //dp.OverrideMetadata(ownerType, typeMetadata); return(dp); }
public DependencyProperty AddOwner(Type ownerType, PropertyMetadata typeMetadata) { DependencyObject.Register(ownerType, this); if (typeMetadata == null) { typeMetadata = new PropertyMetadata(); } OverrideMetadata(ownerType, typeMetadata); // MS seems to always return the same DependencyProperty return(this); }