title: 'Cannot find governing FrameworkElement...' warning when binding inside DataTemplates
body: <p>I'm getting this warning in Visual Studio output window when binding on a SolidColorBrush property <em>inside a DataTemplate</em>:</p>
  
  <blockquote>
    <p>System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=MyColor; DataItem=null; target element is 'SolidColorBrush' (HashCode=22943289); target property is 'Color' (type 'Color')</p>
  </blockquote>
  
  <p>If I bind directly on the rectangle element, <em>outside the DataTemplate</em>, it all works well.</p>
  
  <p>Can anyone explain why this difference in the two apparently similar usages from the sample code below:</p>
  
  <p>My View:</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
  
      &lt;vm:TestViewModel x:Key="_myTestVM"/&gt;
  
      &lt;DataTemplate x:Key="testVMDataTemplate"&gt;
          &lt;Grid&gt;
              &lt;Rectangle Height="30" Width="200" Margin="5"&gt;
                  &lt;Rectangle.Fill&gt;
                      &lt;SolidColorBrush Color="{Binding Path=MyColor}" /&gt;
                  &lt;/Rectangle.Fill&gt;
              &lt;/Rectangle&gt;
          &lt;/Grid&gt;
      &lt;/DataTemplate&gt;
  &lt;/UserControl.Resources&gt;
  
  &lt;Grid&gt;
      &lt;StackPanel DataContext="{StaticResource _myTestVM}"&gt;
          &lt;!-- Binding *outside* the DataTemplate = works fine --&gt;
          &lt;Rectangle Height="30" Width="200" Margin="5"&gt;
              &lt;Rectangle.Fill&gt;
                  &lt;SolidColorBrush Color="{Binding Path=MyColor}"/&gt;
              &lt;/Rectangle.Fill&gt;
          &lt;/Rectangle&gt;
  
          &lt;!-- Binding *inside* the DataTemplate = output warning --&gt;    
          &lt;ContentControl Content="{Binding}" ContentTemplate="{StaticResource testVMDataTemplate}"/&gt;
      &lt;/StackPanel&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>My ViewModel (TestViewModel):</p>
  
  <pre><code>public class TestViewModel {
      private Color _color = Colors.Green;
          public Color MyColor {
              get { return _color; }
          }
  
          public TestViewModel() {
  
          }
    }
  </code></pre>
  
  <p>Update:<br/>
  It evidently has to do with binding the <em>Color</em> property for the <em>SolidColorBrush</em>. The same thing is happening if I bind the <em>Angle</em> property on a <em>RotateTransform</em> object.</p>
  
  <p>Thanks in advance.</p>