From the course: Microsoft XAML: 2 Content and Properties

Unlock the full course today

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

Order of precedence for dependency properties

Order of precedence for dependency properties

From the course: Microsoft XAML: 2 Content and Properties

Start my 1-month free trial

Order of precedence for dependency properties

- [Teacher] In this video, I'll look at the order of precedence for dependency properties. Because multiple services might set a dependency property, the dependency system has a strict order of precedence that it uses to determine which service prevails and sets the value. I'm using WPF for this example. The other XAML frameworks work the same, but they have slightly different priority lists. This is what the demonstration looks like. I'll click on this First Demo button. There's three areas to look at in this demo. On the left side of the screen, near the top, is the items that I'm changing. In this example, I'll be working with TextBlocks. And in this screen, I'm setting the FontWeight, which is the dependency property for all three of these. At the bottom of the screen is a screenshot that shows the Subset of Precedence Order. This is the order that WPF resolves the conflicts. This is a subset, meaning I didn't put everything in here. I simplified it somewhat. When you read this…

Contents