ux:Global attribute in UX Markup converts the element on which it resides into a static global resource.
Static global resources can be used locally in you project, or used to define resource libraries that can be refered from other projects.
<type ux:Global="resource_key" [ux:Value="value"] ... />
type is any type available to UX Markup, and
resource_key is any string.
Allthough not strictly required, it is reccommended to use a
resource_keythat consists of valid Uno identifiers, separated by periods
If the type is a value type (such as
ux:Value attribute must be specified.
As an example, Fuse defines global resources for common color names like
Blue. These can be referred to by their name:
<Panel Color="Blue" />
You can define custom global resources of any type using the
<float4 ux:Global="MyProject.WarmBlue" ux:Value="#18f" />
And then use it anywhere:
<Rectangle> <Stroke Width="3" Color="MyProject.WarmBlue" /> </Rectangle>
Note that global resource names may contain periods
.. It is encouraged to use periods in resource names for grouping according to project, company or context.
Global resources are resolved at compile-time and can not change dynamically. For dynamic resources, see Resources.
Globals as default resources
ux:Global attribute also defines a global default value for resource bindings. See docs on
ux:Key for more info.