From the course: Microsoft XAML: 2 Content and Properties

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Explore the concept of dependency properties

Explore the concept of dependency properties

From the course: Microsoft XAML: 2 Content and Properties

Start my 1-month free trial

Explore the concept of dependency properties

- [Instructor] The dependency property system provides definite benefits for XAML-based UI. Before showing how it works, I'll review the normal dot net property. Imagine you are a developer on the WPF team, and you create the text block class. You add the font size and text properties to your dot net class. When another developer instantiates the class and code and sets the font size property, that value is stored in a backing variable in the memory allocated for the text block class. The same is true for the text property. Its value is stored in another backing variable in the same memory location. Now let's look at what happens when you bring the dependency system into play. It's part of the XAML framework, and it's always available when the application is running. As the author of the text block class, you need to register your intention to use the dependency system. You register each property in the class. Basically, this lets you opt into the features the dependency system…

Contents