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

Content as a dictionary in XAML

From the course: Microsoft XAML: 2 Content and Properties

Start my 1-month free trial

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…

Contents