Dictionaries and hash tables have a place in coding frameworks. This tutorial explores how to use dictionaries of items in XAML files.
- [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 not a visual element.…It's not the Window. It's not a StackPanel.…
- What does content mean in XAML?
- Using dotPeek to show property values for XAML elements
- Expressing content as objects, lists, or dictionaries in XAML vs. code
- Exploring dependency and attached properties
- Working with attached properties in the grid and canvas
- Using custom dependency properties