DenaliHardtail
DenaliHardtail

Reputation: 28336

Adding an image to a button in XAML

I'm trying to add an image to a button in my silverlight 3 application but cannot get the image to appear. I added a folder, named \images, to my Silverlight application folder and an using a relative path in the Source attribute of the Image. What am I doing wrong?

<Button Width="200"
        Height="200">
     <Image Source="images\document.png"></Image>
</Button> 

Upvotes: 1

Views: 3104

Answers (1)

Bryant
Bryant

Reputation: 8670

The easiest way to find out what is going on is to add an event handler for the ImageFailed event to see what URL it is trying to use.

You should probably try using forward slashes instead of back slashes, but I'm not sure if that is the real issue.

Upvotes: 1

Related Questions