title: Binding image source through property in wpf
body: <p>I am trying to display an icon using an image source(.jpg). I create a Icon property in view model and try to assign it the path of the image but I do not see any image in the view. I tried converting the path to Bitmap image but doesn't work. Is there anything I am missing here?</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal"&gt;
                                  &lt;TextBlock Text="{Binding Path=Name}"/&gt;
                                  &lt;Image Source="{Binding Path=Icon}"&gt;&lt;/Image&gt;
                              &lt;/StackPanel&gt;
  
  
  
  
  BitmapImage img = new BitmapImage();
                      img.BeginInit();
                      img.CacheOption = BitmapCacheOption.OnLoad;
                      img.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
                      img.UriSource = new Uri("C:\\Users\\Public\\Pictures\\Sample Pictures\\Chrysanthemum.jpg", UriKind.Absolute);
                      img.EndInit();
                      Icon = img;
  </code></pre>