I have a BitmapImage and I would like to change its source at runtime.
<BitmapImage source="img1.png" id="img" smooth="true" smoothingQuality="high"
<DropShadowFilter distance="-1" angle="45"/>
In the script part, I change its source so it points to another image.
img.source = "img2.png";
If the previous assignment is inside the mouseDown handler, it works perfectly. But, if I place it in a method that is triggered when data is received through a socket, the source remains unchanged.
What I've found out, so far, is: I've added an event listener for the type
"sourceChanged" and this is actually triggered, but when I inspect the source, it points to the old image.
Show more code, like the code that handles the socket event and assigns the new value.
It turned out to be a bug in my code, totally unrelated to sockets or anything else.
Not sure how to proceed...should I close this post?
I think you mark it answered, since you answered it.