How to change the image by the code behind

1

I want to change the image by the code behind, but the path is wrong.

How do I find the path?

BitmapImage image = new BitmapImage(new Uri("/Images;Assets/Images/ativo.png", UriKind.Relative));
img.Source = image;

Note:

The image is in the path: Assets/Images/ .

    
asked by anonymous 24.04.2014 / 19:28

1 answer

1

I did it!

follow the correct code:

BitmapImage image = new BitmapImage(new Uri(@"Assets\Images\inativo.png", UriKind.Relative));
    
24.04.2014 / 19:53