What
The ability to bind the reference of an element to an Observable (or similar). This would be accompanied by access to the Element’s or Control’s methods and functions.
Why
The ability to bind is in the current state wide spread among properties, but it’s lacking when it comes to Elements and Controls. The posibility to bind / reference a node would allow for easy access to methods like the Navigator’s GoTo function.
Examples
Binding an element
/.../
var navigator = Observable();
module.exports = {
navigator: navigator
};
/.../
<!--...-->
<Panel>
<HierarchicalNavigation ux:Name="navigator" ux:Ref="{navigator}" ReuseExistingNode="false" Active="homePage" />
<Page ux:Name="mainPage" />
<Page ux:Name="subPage1" />
<Page ux:Name="subPage2" />
</Panel>
<!--...-->
This binds the by using ux:Ref="{observable}"
Using the referenced Element or Control
/.../
function homeClicked(args){
//Check if the node is referenced in UX in some way
if(navigator.referenced)
navigator.GoTo("homePage");
}
function backClicked(args){
//Check if the node is referenced in UX in some way
if(navigator.referenced)
navigator.GoBack();
}
/.../
Here we use .GoTo() and .GoBack() which are both members of the Navigator class