Hi there,
I’m experiencing some issue when trying to display an image with dynamic source. Like the example in your “Learn” page, this code below works fine:
<App Theme="Basic">
<JavaScript>
var Observable = require("FuseJS/Observable");
var imageKey = Observable("");
module.exports = {
imageKey: "bb"
};
</JavaScript>
<FileImageSource ux:Key="aa" File="Assets/a.jpg" />
<FileImageSource ux:Key="bb" File="Assets/b.jpg" />
<StackPanel>
<Text Value="{imageKey}" />
<Image Source="{DataToResource imageKey}" />
</StackPanel>
</App>
But if I want to use a dynamic key from the Javascript code, the corresponding image does not appearing:
<App Theme="Basic">
<JavaScript>
var Observable = require("FuseJS/Observable");
var imageKey = Observable("bb");
module.exports = {
imageKey: imageKey
};
</JavaScript>
<FileImageSource ux:Key="aa" File="Assets/a.jpg" />
<FileImageSource ux:Key="bb" File="Assets/b.jpg" />
<StackPanel>
<Text Value="{imageKey}" />
<Image Source="{DataToResource imageKey}" />
</StackPanel>
</App>