Binds to a resource with the key provided in a context variable. This allows selecting resources from JavaScript by key name.

In this example three different fonts are created as resources. The font is selected by name in the exported JavaScript items.

<Font File="../../Assets/fonts/Roboto-Bold.ttf" ux:Key="Bold"/>
<Font File="../../Assets/fonts/Roboto-Regular.ttf" ux:Key="Regular"/>
<Font File="../../Assets/fonts/Roboto-Italic.ttf" ux:Key="Italic"/>

    exports.items = [
        { font: "Bold" },
        { font: "Regular" },
        { font: "Italic" },
    <Each Items="{items}">
        <Text Value="Sample Text" Font="{DataToResource font}"/>

{DataToResource variableKey} is similar to {Resource key}, except it allows a variable key name instead of a static one.


Fuse.Reactive.Expressions 1.11.2

Interface of DataToResource

Inherited from Expression

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces

See Also