delete
delete

Reputation:

Adding an Image in xaml code?

How can I add an image to my program in XAML?

I want to display the 'no.png' image on my application. Also,

alt text

I need both yes and no to appear in the same place. My plan was to set them both to hidden and display them only when necessary. How can I do this?

Upvotes: 0

Views: 9454

Answers (2)

felixthehat
felixthehat

Reputation: 847

yep just add the image xaml, and either use visual state manager, behaviours or code behind to switch the visibility

    <Image Source="/Background.png" Visibility="Collapsed"/>
    <Image Source="/Background.png" Visibility="Visible"/>

Upvotes: 3

Mick N
Mick N

Reputation: 14882

You could place the two png's in a StackPanel and programatically control their Visibility setting.

Upvotes: 0

Related Questions