Exemple #1
0
        public static RadProperty Register(string name, Type propertyType, Type ownerType, RadPropertyMetadata typeMetadata, ValidateValueCallback validateValueCallback)
        {
            //RadProperty.RegisterParameterValidation(name, propertyType, ownerType);
            RadPropertyMetadata metadata1 = null;

            if ((typeMetadata != null) && typeMetadata.DefaultValueWasSet())
            {
                metadata1 = new RadPropertyMetadata(typeMetadata.DefaultValue);
            }
            RadProperty property1 = RadProperty.RegisterCommon(name, propertyType, ownerType, AttachedPropertyUsage.Self, metadata1, validateValueCallback);

            if (typeMetadata != null)
            {
                property1.OverrideMetadata(ownerType, typeMetadata);
            }
            return(property1);
        }
Exemple #2
0
        public static RadProperty Register(
            string name,
            Type propertyType,
            Type ownerType,
            RadPropertyMetadata typeMetadata,
            ValidateValueCallback validateValueCallback)
        {
            RadPropertyMetadata defaultMetadata = (RadPropertyMetadata)null;

            if (typeMetadata != null && typeMetadata.DefaultValueWasSet())
            {
                defaultMetadata = new RadPropertyMetadata(typeMetadata.DefaultValue);
            }
            RadProperty radProperty = RadProperty.RegisterCommon(name, propertyType, ownerType, AttachedPropertyUsage.Self, defaultMetadata, validateValueCallback);

            if (typeMetadata != null)
            {
                radProperty.OverrideMetadata(ownerType, typeMetadata);
            }
            return(radProperty);
        }