Example #1
0
        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));
        }
Example #2
0
        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));
        }
Example #3
0
 public static void Override(this DependencyPropertyKey dpKey, PropertyMetadata typeMetadata)
 {
     dpKey.DependencyProperty.OverrideMetadata(ExTool.GetDeclaringType(), typeMetadata, dpKey);
 }
Example #4
0
 public static void Override(this DependencyProperty dp, PropertyMetadata typeMetadata)
 {
     dp.OverrideMetadata(ExTool.GetDeclaringType(), typeMetadata);
 }