go.Picture binding from element to property does not work


I am trying to bind the go.Picture “element” property to a model property (the property contains the base64 encoded image).
However, the image is not displayed, even not when I call updateTargetBindings().

Should this work or is there some mistake?

let picture = new go.Picture();
picture.desiredSize = new go.Size(41, 41);
picture.bind(new go.Binding("element", ValueStreamItemProperty.IMAGE_CLASS, (base64Image: string, obj) => {
    let base64Icon = document.createElement("img");
    base64Icon.src = base64Image;
    return base64Icon;

goJs: 1.8.35

Is your code part of the building of a node template?

Can you confirm that the HTMLImageElement that you create in the conversion function actually looks as you would expect? I suppose you could temporarily put it in the DOM to show it.

Thank you walter, my mistake, I had another binding on the same property somewhere else in the code…
After fixing this it is working as expected!