private DependencyPropertyDescriptor(PropertyDescriptor property, Type componentType, DependencyProperty dependencyProperty)
     : base(dependencyProperty.Name, null)
 {
     _property = property;
     _componentType = componentType;
     _dependencyProperty = dependencyProperty;
     _metadata = dependencyProperty.GetMetadata(componentType);
 }
        public void CoerceValue(DependencyProperty dp)
        {
            if (dp == null)
                throw new ArgumentNullException("dp");

            PropertyMetadata pm = dp.GetMetadata(this);
            if (pm.CoerceValueCallback != null)
                pm.CoerceValueCallback(this, GetValue(dp));
        }
Beispiel #3
0
        public void CoerceValue(DependencyProperty dp)
        {
            if (dp == null)
            {
                throw new ArgumentNullException("dp");
            }

            PropertyMetadata pm = dp.GetMetadata(this);

            if (pm.CoerceValueCallback != null)
            {
                pm.CoerceValueCallback(this, GetValue(dp));
            }
        }