title: How do I bind an Image dynamically in XAML?
body: <p>The following displays an <strong>image</strong> correctly in a <strong>silverlight</strong> usercontrol:</p>
  
  <pre><code>Image image = pagingManager.BaseApp.DatasourceManager.GetImage("helloWorld1");
  ContentArea.Content = image;
  ...
  &lt;ContentControl x:Name="ContentArea"/&gt;
  </code></pre>
  
  <p>However, I want to <strong>dynamically</strong> bind the image to <strong>XAML</strong>, e.g. like this:</p>
  
  <pre><code>#region ViewModelProperty: MainImage
  private Image _mainImage;
  public Image MainImage
  {
      get
      {
          return _mainImage;
      }
  
      set
      {
          _mainImage = value;
          OnPropertyChanged("MainImage");
      }
  }
  #endregion
  ...
  MainImage = pagingManager.BaseApp.DatasourceManager.GetImage("helloWorld1");
  </code></pre>
  
  <p>And my <strong>XAML</strong> is this but the result is that it shows <strong>nothing</strong>:</p>
  
  <pre><code>&lt;Image Source="{Binding MainImage}"/&gt;
  </code></pre>
  
  <p><strong>What do I need to put in my XAML to make it display the image object I have in my ViewModelProperty?</strong></p>