Beispiel #1
0
        public object GetVisualStateValue(DependencyProperty dependencyProperty) //todo: see if this is actually useful (to get specifically the VisualStateValue) and if so, change the GetValue into a GetVisualStateValue at the "return" line.
        {
            if (dependencyProperty == null)
            {
                throw new ArgumentNullException("No property specified");
            }

            var storage = INTERNAL_PropertyStore.GetStorage(this, dependencyProperty, createAndSaveNewStorageIfNotExists: true);

            return(INTERNAL_PropertyStore.GetValue(storage));
        }
        public object GetAnimationValue(DependencyProperty dependencyProperty)
        {
            if (dependencyProperty == null)
            {
                throw new ArgumentNullException("No property specified");
            }

            var storage = INTERNAL_PropertyStore.GetStorage(this, dependencyProperty, createAndSaveNewStorageIfNotExists: true);

            return(INTERNAL_PropertyStore.GetValue(storage));
        }
Beispiel #3
0
        public object GetAnimationValue(DependencyProperty dependencyProperty)
        {
            if (dependencyProperty == null)
            {
                throw new ArgumentNullException("No property specified");
            }

            var storage = INTERNAL_PropertyStore.GetStorageIfExists(this, dependencyProperty);
            PropertyMetadata typeMetadata = dependencyProperty.GetTypeMetaData(this.GetType());

            return(INTERNAL_PropertyStore.GetValue(storage, typeMetadata));
        }
Beispiel #4
0
        public object GetVisualStateValue(DependencyProperty dependencyProperty) //todo: see if this is actually useful (to get specifically the VisualStateValue) and if so, change the GetValue into a GetVisualStateValue at the "return" line.
        {
            if (dependencyProperty == null)
            {
                throw new ArgumentNullException("No property specified");
            }

            var storage = INTERNAL_PropertyStore.GetStorageIfExists(this, dependencyProperty);
            PropertyMetadata typeMetadata = dependencyProperty.GetTypeMetaData(this.GetType());

            return(INTERNAL_PropertyStore.GetValue(storage, typeMetadata));
        }
Beispiel #5
0
        internal List <DependencyProperty> INTERNAL_PropertiesForWhichToCallPropertyChangedWhenLoadedIntoVisualTree; // When a UI element is added to the Visual Tree, we call "PropertyChanged" on all its set properties so that the control can refresh itself. However, when a property is not set, we don't call PropertyChanged. Unless the property is listed here.

        /// <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)
        {
//#if PERFSTAT
//          var t = Performance.now();
//#endif
            var storage = INTERNAL_PropertyStore.GetStorageIfExists(this, dependencyProperty);
            PropertyMetadata typeMetadata = dependencyProperty.GetTypeMetaData(this.GetType());
            var tmp = INTERNAL_PropertyStore.GetValue(storage, typeMetadata);

//#if PERFSTAT
//          Performance.Counter("DependencyObject.GetValue [" + dependencyProperty.Name + "]", t);
//#endif
            return(tmp);
        }
Beispiel #6
0
        internal List <DependencyProperty> INTERNAL_PropertiesForWhichToCallPropertyChangedWhenLoadedIntoVisualTree; // When a UI element is added to the Visual Tree, we call "PropertyChanged" on all its set properties so that the control can refresh itself. However, when a property is not set, we don't call PropertyChanged. Unless the property is listed here.

        /// <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)
        {
//#if PERFSTAT
//            var t = Performance.now();
//#endif
            var storage = INTERNAL_PropertyStore.GetStorage(this, dependencyProperty);
            //return dependencyProperty.Store.GetValue(storage);

            var tmp = INTERNAL_PropertyStore.GetValue(storage);

//#if PERFSTAT
//            Performance.Counter("DependencyObject.GetValue [" + dependencyProperty.Name + "]", t);
//#endif
            return(tmp);
        }