<App Theme="Basic">
<JavaScript>
var Observable = require("FuseJS/Observable");
module.exports = {
half: Observable("50%")
}
</JavaScript>
<Rectangle Width="{half}" Fill="#F00" Height="10"/>
The preview stops with with unknown char
, however using <Rectangle Width="50%" />
works as expected.
Hi!
This is unfortunately a limitation of how Fuse works (as of 0.9.11)
You can get around it like this:
<App Theme="Basic">
<JavaScript>
var Observable = require("FuseJS/Observable");
module.exports = {
half: Observable(50)
}
</JavaScript>
<Rectangle ux:Name="rect1" Width="0%" Fill="#F00" Height="10"/>
<DataBinding Target="rect1.Width" Key="half" />
</App>
Hi,
I just implemented support for this. It will likely roll out in Fuse 0.11
<App>
<JavaScript>
exports.width1 = "50";
exports.width2 = "50px";
exports.width3 = "50%";
</JavaScript>
<StackPanel>
<Panel Color="Red" Width="{width1}" Height="100" />
<Panel Color="Green" Width="{width2}" Height="100" />
<Panel Color="Blue" Width="{width3}" Height="100" />
</StackPanel>
</App>
(Also works with Observables)