Esempio n. 1
0
        private static DependencyProperty RegisterDynamicProperty(DependencyProperty property)
        {
            var propertyType = property.GetPropertyType();

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

            return(defaultMetadataValue.IsDependencyPropertyUnsetValue() ? dependencyProperty.GetPropertyType().CreateDefaultValue() : defaultMetadataValue);
        }
Esempio n. 3
0
 public static string GetTypeName(this DependencyProperty dependencyProperty)
 {
     return(dependencyProperty.GetPropertyType()?.Name ?? "Unknown");
 }