This entity is experimental and might be changed or removed in a future release.

Binds an expression or value to a name in the data context. This simplifies repeated calculations and allows introduction of new variables.

To introduce a new value:

<Let ux:Name="a" Value="5"/>

The value is now part of the data context:

<Slider Value="{a}"/>

It can also be accessed directly outside of the context:

<Slider Value="{Property a.Value}"/>

If you are using an expression it's recommended now to use Expression instead of Value:

<Let ux:Name="p" Expression="{pos} + 5"/>

This ensures proper propagation of undefined values. (This is part of the reason this is an experimental API, since we don't really want to distinguish between Expression and Value, but have no choice at the moment).

LetType

If you are creating a value of a specific type, and/or need to use Change or other animators, consider using one of the LetType classes instead, such as LetFloat or LetString. They have a cleaner conversion mechanism, leading to fewer surprises.

Experimental since there are some fine details about handling observables, nulls, and expressions that aren't quite defined and might subtlely alter the behaviour. For typical use-cases it should be okay though.

Location

Namespace
Fuse.Reactive
Package
Fuse.Reactive.Bindings 2.9.1
Show Uno properties and methods

Interface of Let

Inherited from LetBase

Inherited from Node

ContextParent : Node uno

The context parent is the semantic parent of this node. It is where non-UI structure should be resolved, like looking for the DataContext, a Navigation, or other semantic item.

FindNodeByName(Selector, Predicate<Node> (Node)) : Node uno

Finds the first node with a given name that satisfies the given acceptor. The serach algorithm works as follows: Nodes in the subtree are matched first, then it matches the nodes in the subtrees ofthe ancestor nodes by turn all the way to the root. If no matching node is found, the function returns null.

IsRootingStarted : bool uno

Whether rooting of this node has started. Note that even if this property returns true, rooting may not yet be completed for the node. See also IsRootingCompleted.

Name : Selector ux

Run-time name of the node. This property is automatically set using the ux:Name attribute.

OnRooted uno

If you override OnRooted you must call base.OnRooted() first in your derived class. No other processing should happen first, otherwise you might end up in an undefined state.

Inherited from PropertyObject

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

ISiblingDataProvider uno

When implemented by a Node, it indicates that the node provides data for its siblings. hide

IObject uno

Represents a key-value object, where the keys can be enumerated and looked up by string name.

IScriptObject uno

Interface for objects that can have a script engine representation