title: Binding Fill property in class derived from Shape
body: <p>I struggle with binding <strong>FillProperty</strong> in a classe derived from Shape.</p>
  
  <pre><code>public static readonly DependencyProperty NumberNodeProperty = DependencyProperty.Register("Number", typeof(int), typeof(MyDerivedShape), new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.AffectsMeasure |      FrameworkPropertyMetadataOptions.AffectsParentMeasure));
  
  public MyDerivedShape( DerivedViewModel viewmModel):Shape
  {
     DataContext = viewmModel;
  
     Binding FillColorBinding = new Binding("FillColor");
     SetBinding(FillProperty, FillColorBinding);
  
     Binding numberBinding = new Binding("Number");
     SetBinding(NumberNodeProperty, numberBinding);
  } 
  </code></pre>
  
  <p>"FillColor" property is declared in a base Viewmodel, from which DerivedViewModel inherits.</p>
  
  <p>"Number" property is declared in DerivedViewModel</p>
  
  <p>FillProperty is the default  dependency property in Shape base class.</p>
  
  <p>NumberNodeProperty is a dependency property declared in MyDerivedShape</p>
  
  <p>So , what happens is that when I change "Number" in the DerivedViewModel, change is propagated to the Shape (the Shape draws a number)</p>
  
  <p>But when I change FillColor in the DerivedViewModel, Change is not propagated, and color is not changed . I use  FillColor is of type SolidColorBrush.</p>
  
  <p>It seems that the binding does not work... Is it a consequence "Inherits" property set to false for "FillProperty" depedency property ?</p>