public static DependencyProperty RegisterAttached <T>(PropertyMetadata defaultMetadata = null, ValidateValueCallback validateValueCallback = null, [CallerMemberName] string dpName = null) { var propertyName = GetPropertyName(PropertyRegex, dpName); var ownerType = ExTool.GetDeclaringType(); return(DependencyProperty.RegisterAttached(propertyName, typeof(T), ownerType, defaultMetadata, validateValueCallback)); }
public static DependencyPropertyKey RegisterReadOnly(PropertyMetadata typeMetadata = null, ValidateValueCallback validateValueCallback = null, [CallerMemberName] string dpName = null) { var propertyName = GetPropertyName(PropertyKeyRegex, dpName); var ownerType = ExTool.GetDeclaringType(); return(DependencyProperty.RegisterReadOnly(propertyName, GetPropertyType(ownerType, propertyName), ownerType, typeMetadata, validateValueCallback)); }
public static void Override(this DependencyPropertyKey dpKey, PropertyMetadata typeMetadata) { dpKey.DependencyProperty.OverrideMetadata(ExTool.GetDeclaringType(), typeMetadata, dpKey); }
public static void Override(this DependencyProperty dp, PropertyMetadata typeMetadata) { dp.OverrideMetadata(ExTool.GetDeclaringType(), typeMetadata); }