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.
Content as an object in XAML
From the course: Microsoft XAML: 2 Content and Properties
Content as an object in XAML
- [Instructor] In this video, I'll look at how to assign content to a control or an element, that only supports a single child content. Most of those derive from this base class here, it's called content control. I've opened up dot peak, I've disassembled the code for the content control, and you'll see that on line 28 it says that the content property is named content. Here's where that property's defined, and the interesting thing here is that the data type of this property is object. That means that any type in dot net can be used as content inside the content control. You're probably asking yourself what are some of the content controls? Let me show you. Switch over to visual studio, I've opened this file here called content controls dot CD, that stands for class diagram, and this allows you to have a visual representation of your classes and your base classes. And here's content control, and here's the button class, this is the one I'll be using most in this demo, button, and it…
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)
What does content mean in XAML?3m 41s
-
(Locked)
Use children elements as content7m 5s
-
(Locked)
Install the dotPeek utility1m 16s
-
How each element defines a content property5m 28s
-
(Locked)
Content as an object in XAML6m 32s
-
(Locked)
Content as an object in code5m 33s
-
(Locked)
Visual content in panels4m 59s
-
(Locked)
Content as a list in XAML3m 53s
-
(Locked)
Content as a list in code3m 6s
-
(Locked)
Content as a dictionary in XAML4m 53s
-
(Locked)
Content as a dictionary in code1m 25s
-
(Locked)
-
-