WPF Binding Image Soure

Evening, I'm a little confused as to why this is not working i have a custom error handling window that has an image based on error, warning, information the model and view model(datacontext) are updating correctly and the binding path is correct but the image wont refresh
can anybody help
error message
Severity Count Data Context Binding Path Target Target Type Description File Line Project
Warning 1 SimpleNotification_ViewModel SimpleNotificationImagePath Image.Source, Name='Img_SimpleNotification' ImageSource Failed to convert value './Images/NikolaError.png' (type 'String') to the target type using converter 'TargetDefaultValueConverter'. The fallback value will be used if it's available. IOException:'System.IO.IOException: Cannot locate resource 'images/nikolaerror.png'.
I can change the fall back to any on of the four images and they all work, so i know they exist.
Do IO have to do some conversion to make them a source object?
Have you set Build Action -> Resource for those images?
Content Copy If Newer
@Marc Jeeves
Could you check if the
NikolaError.png
is locked? If it is locked, please unlock it. Sometimes, the picture itself may be problematic, I suggest you create a newNikolaError.png
.Try with Resource and see whether it works. Do you need
./
before Images?Sign in to comment
2 answers
Sort by: Most helpful
So the mystery deepens, after reading a couple of posts i decided to convert it to a bitmap and bind to a bitmap property,
it still did not work, but when i pause the code and inspect the bitmap and then allow the code to continue to then works???? WTF.
I'm guessing something is being lazily loaded somewhere by WPF, but this is just a guess
Sign in to comment
I also tried to use a convertor but i have the same issue if i dont inspect the bitmap conversion the image is not shown if i pause the code and look at the bitmap then it shows
Sign in to comment