public object GetValue(DependencyProperty dependencyProperty)
        {
            if (dependencyProperty == null)
            {
                throw new ArgumentNullException("dependencyProperty");
            }
            if (dependencyProperty.IsEvent)
            {
                throw new ArgumentException(SR.GetString("Error_DPGetValueHandler"), "dependencyProperty");
            }
            PropertyMetadata defaultMetadata = dependencyProperty.DefaultMetadata;

            if (defaultMetadata.GetValueOverride != null)
            {
                return(defaultMetadata.GetValueOverride(this));
            }
            return(this.GetValueCommon(dependencyProperty, defaultMetadata));
        }
Ejemplo n.º 2
0
        public object GetValue(DependencyProperty dependencyProperty)
        {
            //Return the property values
            if (dependencyProperty == null)
            {
                throw new ArgumentNullException("dependencyProperty");
            }

            if (dependencyProperty.IsEvent)
            {
                throw new ArgumentException(SR.GetString(SR.Error_DPGetValueHandler), "dependencyProperty");
            }

            // Get type-specific metadata for this property
            PropertyMetadata metadata = dependencyProperty.DefaultMetadata;

            if (metadata.GetValueOverride != null)
            {
                return(metadata.GetValueOverride(this));
            }

            return(GetValueCommon(dependencyProperty, metadata));
        }