Exemple #1
0
        /// <summary>
        /// Returns the current effective value of a dependency property from a DependencyObject.
        /// </summary>
        /// <param name="dependencyProperty">
        /// The DependencyProperty identifier of the property for which to retrieve the
        /// value.
        /// </param>
        /// <returns>Returns the current effective value.</returns>
        public object GetValue(DependencyProperty dependencyProperty)
        {
            INTERNAL_PropertyStorage storage;

            if (INTERNAL_PropertyStore.TryGetStorage(this, dependencyProperty, false /*don't create*/, out storage))
            {
                return(INTERNAL_PropertyStore.GetEffectiveValue(storage));
            }
            return(dependencyProperty.GetTypeMetaData(this.GetType()).DefaultValue);
        }