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.
Content as a dictionary in XAML
From the course: Microsoft XAML: 2 Content and Properties
Content as a dictionary in XAML
- [Instructor] XAML files contain a lot of UI elements, that are arranged in a hierarchical tree, content within content. That's what I've been looking at, in this chapter. Various controls, buttons, panels, and list controls. There are parts of a XAML file that are not directly related to visual elements, however. I'm referring to items like animations, styles, templates, colors, and brushes. These are used by UI elements, but they are not considered part of the visual tree. Nonetheless, it is useful to create these items in XAML. The way you do that, is to create a Resource Dictionary, and add dictionary items to it. And, since I'm talking about them in this chapter, you know there has to be a way to use a content approach to adding child elements to the Resource Dictionary. There's two main ways, of creating a Resource Dictionary in a project. One way, is to create a separate XAML file, like this example dictionary. And, then, you put a root element of ResourceDictionary. This is…
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
-
-
-
What does content mean in XAML?3m 41s
-
Use children elements as content7m 5s
-
Install the dotPeek utility1m 16s
-
How each element defines a content property5m 28s
-
Content as an object in XAML6m 32s
-
Content as an object in code5m 33s
-
Visual content in panels4m 59s
-
Content as a list in XAML3m 53s
-
Content as a list in code3m 6s
-
Content as a dictionary in XAML4m 53s
-
Content as a dictionary in code1m 25s
-
-
-