Пример #1
0
        private static DependencyProperty RegisterDynamicProperty(DependencyProperty property)
        {
            var propertyType = property.GetPropertyType();

            return(DependencyPropertyManager.RegisterAttached(GetDynamicPropertyName(property), propertyType, typeof(StyleService), new PropertyMetadata(propertyType.CreateDefaultValue())));
        }
Пример #2
0
        public static object GetDefaultValue(Type forType, DependencyProperty dependencyProperty)
        {
            var defaultMetadataValue = GetMetadataDefaultValue(forType, dependencyProperty);

            return(defaultMetadataValue.IsDependencyPropertyUnsetValue() ? dependencyProperty.GetPropertyType().CreateDefaultValue() : defaultMetadataValue);
        }
Пример #3
0
 public static string GetTypeName(this DependencyProperty dependencyProperty)
 {
     return(dependencyProperty.GetPropertyType()?.Name ?? "Unknown");
 }