From the course: Microsoft XAML: 2 Content and Properties
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
The trouble with normal .NET properties for UI
From the course: Microsoft XAML: 2 Content and Properties
The trouble with normal .NET properties for UI
- [Instructor] WPF, Silverlight, and Universal Windows applications are built on the .NET framework, so all the visual elements are really .NET types. They have properties, events, and methods like any .NET type. But Microsoft knew there were potential problems with building a UI system on a managed type system. So when they built WPF, the first system to use XAML, they tried to mitigate some of the issues. The outcome of that research is a set of features that extend .NET. For example, they knew that building a UI out of thousands of intertwined managed UI controls and shapes would take up memory, so they came up with a sparse memory management system. They wanted an event system better adapted to a hierarchical representation of a visual interface, so they added a routed event model to WPF, and they created a new property system called the Dependency Property System. That's the focus of this chapter. I'll look at dependency properties, and their close cousins, the attach properties.…
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
-
-
-
-
The trouble with normal .NET properties for UI7m 56s
-
Explore the concept of dependency properties4m 33s
-
Use some dependency properties4m 53s
-
Order of precedence for dependency properties8m 56s
-
Explore the concept of attached properties4m 35s
-
Attached properties with the grid3m
-
Attached properties with the canvas3m 36s
-
Concepts of custom dependency properties3m 10s
-
Register the custom dependency property3m 20s
-
Use the custom dependency properties2m 1s
-
-