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
From the course: Microsoft XAML: 2 Content and Properties
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
The trouble with normal .NET properties for UI7m 56s
-
(Locked)
Explore the concept of dependency properties4m 33s
-
Use some dependency properties4m 53s
-
(Locked)
Order of precedence for dependency properties8m 56s
-
(Locked)
Explore the concept of attached properties4m 35s
-
(Locked)
Attached properties with the grid3m
-
(Locked)
Attached properties with the canvas3m 36s
-
(Locked)
Concepts of custom dependency properties3m 10s
-
(Locked)
Register the custom dependency property3m 20s
-
(Locked)
Use the custom dependency properties2m 1s
-
(Locked)
-