The Dependency Property System provide definite benefits for XAML-based UI. This tutorial looks at why they are needed in XAML-based UI frameworks. Also explore what services become available when a centralized system like this is added to a UI framework.
- View Offline
- [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 provides.…Now your text property can participate in data binding,…
- What does content mean in XAML?
- Using dotPeek to show property values for XAML elements
- Expressing content as objects, lists, or dictionaries in XAML vs. code
- Exploring dependency and attached properties
- Working with attached properties in the grid and canvas
- Using custom dependency properties