Dear Fuse-Community
I wanted to Databind an ux:Global and got this output:
Global objects do not support bindings. Pro tip: Create a ux:Class and create a global instance of that instead.
Sadly im not a āProā xD
I defined Global Colors and implemented them in various places in the ux.
All works great and when I change the Global color in the code and recompile the app I see my new āthemeā.
Now I wanted to change the color inside my app, to preview different colors without recompiling.
Preferable I would like to have an <TextInput>
to define a color.
I simpled everything down to following code:
The commented lines are some tries
<App>
<JavaScript>
var Observable = require("FuseJS/Observable");
var yzcolor = Observable('#FF0000');
module.exports = {
yzcolor: yzcolor
};
</JavaScript>
<SolidColor ux:Global="YZmainColor" Color="#FF0000" />
<float4 ux:Global="YZmainColorFL" ux:Value="#0000FF" />
<!--
<SolidColor ux:Global="YZmainColor" Color="{yzcolor}" />
<float4 ux:Global="YZmainColorFL" ux:Value="#0000FF" /> -->
<!-- <SolidColor ux:Class="YZmainColor0" Color="{yzcolor}" />
<float4 ux:Global="YZmainColorFL" ux:Value="#3b5998" />
<YZmainColor0 ux:Global="YZmainColor" />
-->
<StackPanel>
<Rectangle Color="YZmainColorFL" Width="100%" Height="50"/>
<Rectangle Width="100%" Height="50" Background="YZmainColor">
<Text Value="HelloWorld" Color="YZmainColorFL" />
</Rectangle>
<Rectangle Color="YZmainColorFL" Width="100%" Height="50"/>
<TextInput MaxLength="7" Value="{yzcolor}" />
<Button Text="Do It">
<Clicked>
<!-- <Set Target="YZmaincolor.Color" Value="{yzcolor}" />
-->
</Clicked>
</Button>
</StackPanel>
</App>
Any Help would be awesome
Cheers
Blade