ResourceDictionary
¶
A resource dictionary is a container that maps resource IDs to resources. A node can refer to resources by setting resource IDs to resource ID properties. You can set a resource dictionary to the node or to any of its parent nodes to define which resources the node uses. You can use a resource dictionary to group similar resources to logical entity, such as themes or locales, and change a resource dictionary of a node to change multiple resources at the same time.
Use Node::acquireResource to get the resource from the resource dictionary of a node or from the resource dictionaries of its parent nodes.
A resource dictionary can map resource IDs to resources in these ways:
Use acquire and tryAcquire functions to get a mapped resource regardless of the way how a resource ID is mapped to a resource.
You can store nested resource dictionaries in a resource dictionary. When you are getting a resource from a resource dictionary and the resource dictionary cannot find the resource ID you specify, the resource dictionary looks for the resource ID recursively in the nested resource dictionaries.
In a resource dictionary you can store resources without mapping a resource ID to them. In Kanzi Engine such resources are called anonymous resources. You can get anonymous resources with beginAnonymousResources and endAnonymousResources.
Inherits properties and message types from ResourceDictionaryMetadata.
Creates a resource dictionary.
| name | (string) | The name of the resource dictionary. |
| (ResourceDictionary) | The pointer to the resource dictionary. |