Quantcast
Viewing all articles
Browse latest Browse all 18858

Image in user control will not show at design time when embedded in window but will work at run time

I have read other answers so similar questions about this but they had project items at different levels but I don't.

My project is structured as follows:
Windows\  contains xaml for windows
UserControls\  contains xaml for user controls
Images\   contains .png files

My program all runs fine and correct at run time.

When I am including images into xaml I am doing it like this:

<Image Source="/Images/ImageName.png" />

At design time when I use an image in a window it shows up fine.

At design time when I use an image in a user control is shows up fine.

At design time when I put a user control containing an image in a window it just shows a red X and gives the error:
Cannot locate resource images/imageName.png.  At run time of course this window displays just fine.

(Just an observation note also: the first char of the image name has been lower cased in the error message).


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>