Changing image file dinamically inside a class


i want to create a image selector and i can’t make it work as a class.

This is working (no class):


<Panel Height="80" Width="80">
    <Clicked Handler="{onSelectPicture}"/>
    <Image File="{image}" Width="80" Height="80" StretchMode="UniformToFill"/>
    <Image File="defaultNoImage.png" Width="80" Height="80" StretchMode="UniformToFill"/>


image = Observable();
function onSelectPicture(){
image.value = "myPicture.png";

when i try to convert it to a class it does not work:


<Panel ux:Class="PictureSelector" Height="80" Width="80">
    <Clicked Handler="{clicked}"/>
    <Image File="{image}" Width="80" Height="80" StretchMode="UniformToFill"/>

<Each Items="{selectorsList}">


 function PictureSelector(file) {
this.image = Observable(file),

this.clicked = function() {
	console.log("clicked!"); // <-- it shows the message
	this.image.value = "myPicture.png";

 selectorsList.add(new PictureSelector("defaultFile.png"));

if i add some text (like the file name) the text changes but not the image… any help would be apreciated

It seems now it’s working (no idea why :slight_smile: ) i guess i had some error or it was a preview error.