title: Conditional FrameworkElements depending on DataContext
body: <p>In my M-V-VM application I have to show the user's avatar. The image is provided in a property of type ImageSource the ViewModel object. So that's what I have currently:</p>
  
  <pre><code>&lt;Image Source="{Binding Path=UserAvatar}"/&gt;
  </code></pre>
  
  <p>However, some users may not have an avatar configured, so UserAvatar is <code>null</code>. In that case I want to show a default avatar. Noone but the view must know about the default image, because it's just a concern of presentation.</p>
  
  <p>So how can I either show the image with the given ImageSource, or a specific resource if ImageSource is <code>null</code>. Do I have to use some kind of DataTemplate with DataTriggers? Since now I only used them for ItemsControls, so I don't know.</p>