This problem makes me confused. I simply set Background
of my Window
to an ImageBrush
all using Properties
window at design time. First, I add a JPG
image to my Resources
(Double-click on Resources -> Select Images -> Add Existing File ...). Then I select my Window
, open Properties
window to select ImageSource
for the Background
property. It shows the image OK at that time. But when running the application, it throws the exception:
'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '75' and line position '10
I don't understand this exception well, searching with Goolge won't help much because there are many various exceptions (inner exception) can throw this. In my case the inner exception is Could not find a part of the path 'D:\Ellipse button with Animation\bin\Debug\Resources\back_ground.jpg'.
The strangest thing is it shows the image OK at design time, but at run time, that exception is thrown.
Do you have any idea to solve this? Thanks!