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.
Use the custom dependency properties
From the course: Microsoft XAML: 2 Content and Properties
Use the custom dependency properties
- [Instructor] I have my star shape user control and I created a custom dependency property and I'm ready to instantiate it in XAML and make some changes in the code behind. I'll do that in this MainWindow.xaml file. So here's my instances of my star shape inside the Stack Panel and I bring them into scope, they're inside this project, so I bring them into scope by putting this namespace here at my Window class. So I say namespace:local and I bring this scope all the types that are inside my project, then I instantiate the star shape here and then I start working with the properties. Now to refresh our memory, let's go over to the star shape. I have this CLR property called Points, and also when I registered it, I called it Points here so that's the name I'll use in my XAML. Point equal five and Points equal six and you can see those being rendered over here in the UI Designer. Let's see if it works when I change the value. I'll change this to six, and you see over in the Designer I…
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)
-