#116 – Dependency Property Values Are Stored in the DependencyObject

Standard CLR property values are stored in the instance of the object where the property is defined.  Even if you never change a property from its default value, it still takes up memory in the object.

Values of dependency properties are stored only if a dependency property has been set to a non-default value.  For properties that you haven’t set, the default value for the property is returned whenever a client reads the property.

Values for dependency properties that have been set are stored in an array in the object that inherits from DependencyObject and owns the property.  This array, as well as the GetValue and SetValue methods for reading/writing properties, is part of the implementation of DependencyObject that a derived class inherits. The internal array contains effective values for each dependency property whose value has been set.

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 131 other followers