File Path for Source Property not work properly
I have "WPF userControl Library" project. In it I have window which has next line of code
<Image x:Name="imgInstructionIcon" Source="images/InfoIcon.png" >
and also in project I have "images" folder which contains InfoIcon.png file. But My code didn't see this file and give next error:
Error 58 The file images/InfoIcon.png is not part of the project or its 'Build Action' property is not set to 'Resource'
When I change path to the Source=../images/InfoIcon.png I see my icon in designer but not see in runtime. My project is part of Solution.
Try the uri pack syntac - Read more here
Set the Source="images/InfoIcon.png", BuildAction to Resource and compile the application. Now you can see in designer as well as runtime.
Try doing as the error says: select the image in the solution explorer, then in the properties set the build action to resource. It should fix your problem.