Let Class
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
Interface of Let
Let Constructor uno
Creates a new Let
SetValue(object, IPropertyListener) uno
Value : object ux
Inherited from LetBase
OnRootedValue uno
SetObjectValue(object, IPropertyListener) uno
Inherited from Node
Add(Binding) uno
Bindings : IList of Binding ux
The list of bindings belonging to this 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.
FindByType<T> : T uno
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.
GetNearestAncestorOfType<T> : T uno
Insert(int, Binding) uno
IsRootingCompleted : bool uno
Whether rooting for this node is completed. Returns false if unrooting has started.
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.
NextSibling<T> : T uno
Returns the next sibling node of the given type.
OnDataChanged(string, object) uno
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.
OnUnrooted uno
Parent : Visual uno
The parent Visual of this node. Will return null if the node is not rooted.
PreviousSibling<T> : T uno
Returns the next sibling node of the given type.
Properties : Properties uno
A linked list holding data for extrinsic properties.
Remove(Binding) : bool uno
SoftDispose uno
SourceFileName : string ux
hide
SourceLineNumber : int ux
hide
SubtreeToString : string uno
SubtreeToString(StringBuilder, int) uno
TryGetResource(string, Predicate<object> (object), object) : bool uno
VisitSubtree(Action<Node> (Node)) uno
Inherited from PropertyObject
AddPropertyListener(IPropertyListener) uno
OnPropertyChanged(Selector, IPropertyListener) uno
OnPropertyChanged(Selector) uno
RemovePropertyListener(IPropertyListener) uno
Inherited from object
Equals(object) : bool uno
GetHashCode : int uno
GetType : Type uno
ToString : string uno
Attached UX Attributes
GlobalKey (attached by Resource) : string ux
Implemented Interfaces
IListener uno
ISiblingDataProvider uno
When implemented by a Node
, it indicates that the node provides data for its siblings.
hide
IObject uno
IPropertyListener uno
IList<Binding> uno
IScriptObject uno
Interface for objects that can have a script engine representation
IProperties uno
ISourceLocation uno
hide