Hi,
it looks like the data-binding sometimes happens “too late”, letting time for errors to be triggered. Let’s point out three different examples.
First example : I have a PageControl with a dynamic number of pages (depending on a JS object). Let’s say 3, named “page0”, “page1” and “page2”. And I want page1 to be the Active one at the beginning. The code would looks something like :
<PageControl Active="page1">
<Each Items="pages">
<Page ux:Name="{name}">
...
</Page>
</Each>
</PageControl>
which fails because “No node has name page1”.
Second example : I want an AddingAnimation to move an object of a distance determined by a JS variable, named “position”.
<Move Y="{position}" Duration="0.3" Easing="QuadraticInOut" />
Then the fuse preview
command fails. I have to comment this line, launch fuse preview
, then save again this file and wait for the live refresh.
Third example : This one doesn’t triggered an error and has an easy workaround, but it shows well how we have to be vigilant with databinding and espacially <Each/>
. I want a header, a (dynamic) list of elements and a footer. This code :
<Header/>
<Each Items="elts">
<Text Value="{title}"/>
</Each>
<Footer/>
will put the footer before my elements, cause the Footer element is added to the parent before Text elements are computed. (Of course wrapping the Each in a Panel fixes it, not a real problem this time).
How can I fix this (espacially example 1 and 2) ?
Thanks