Setting Image control's Source in code behind [Solved]
-
Greetings! I have an
Image
control and I'm trying to set itsImage.Source
programatically (I'm trying to point it to a web url). However, eventhough I'm able to do this in XAML, I'm not able to do it in my C# code. Is there a workaround for this? Any enlightening words you may have on this are highly appreciated :) Thanks.modified on Thursday, March 4, 2010 4:42 PM
-
Greetings! I have an
Image
control and I'm trying to set itsImage.Source
programatically (I'm trying to point it to a web url). However, eventhough I'm able to do this in XAML, I'm not able to do it in my C# code. Is there a workaround for this? Any enlightening words you may have on this are highly appreciated :) Thanks.modified on Thursday, March 4, 2010 4:42 PM
This worked:
ImageSourceConverter converter = new ImageSourceConverter();
image1.Source = (ImageSource)converter.ConvertFromString("http://myurlwithapicture/pic.jpg");Awesome.