2

This is my XAML

<Image Name="StatusImage" Source="/Foo.Bar.Sam;component/Images/YellowDot.png" Stretch="Fill" MaxWidth="12" MaxHeight="12">

Using VB or C#, how would I change the Image to RedDot or GreenDot?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
  • Duplicate - http://stackoverflow.com/questions/397117/wpf-image-dynamically-changing-image-source-during-runtime – ChrisF Jan 25 '10 at 23:45

1 Answers1

2

code taken from answer to this question

string strUri2 = String.Format(@"pack://application:,,,/MyAseemby;component/resources/main titles/{0}", CurrenSelection.TitleImage);
imgTitle.Source = new BitmapImage(new Uri(strUri2));
Community
  • 1
  • 1
Muad'Dib
  • 28,542
  • 5
  • 55
  • 68
  • If you find a duplicate question, then you should comment and vote to close rather than posting an answer. – ChrisF Jan 25 '10 at 23:46
  • thanks for the tip. After reviewing the other q, I don't think its a duplicate question. The other question was about image resizing. – Muad'Dib Jan 26 '10 at 00:21