I am using an Image in xaml like below,
<Image x:Name="JustMyImage" Width="635" Height="120" Canvas.Left="-19" Canvas.Top="-19" Source="../images/UnCategorized/Anywhere.png"/>
If i want to dynamically change the image source i need to do the following code
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(".\images\panel.PNG", UriKind.Relative);
bi.EndInit();
this.JustMyImage.Source = bi;
Is there a straight forward ‘one line’ method to replace the image.
You can do like this: