title: Setting background of content control
body: <pre><code>&lt;UserControl .....&gt;
    &lt;DataTemplate DataType="{x:Type vm:AViewModel}"&gt;
      &lt;vw:AView /&gt;
    &lt;/DataTemplate&gt;
  
    &lt;DataTemplate DataType="{x:Type vm:BViewModel}"&gt;
      &lt;vw:BView /&gt;
    &lt;/DataTemplate&gt;
  
    &lt;ContentControl x:Name="chartScreen" Content="{Binding Screen}" Background="Yellow" /&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>As you can see from above code, ContentControl is setting its content through binding to ViewModel's Screen property. Screen property will return an instance of AViewModel or BViewModel, depending on some condition. The problem is, when UserControl is loaded on screen, Screen property is null, so there is no content set yet. At this point, I would like to set some background for the ContentControl, but I cannot find a way how to do this? Background="Yellow" does nothing...</p>
  
  <p>Any ideas how to set the background of ContentControl? This backgound should be applied always, even when content is displaying AView or Biew, or null.</p>