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

Use the custom dependency properties

From the course: Microsoft XAML: 2 Content and Properties

Start my 1-month free trial

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…

Contents