title: WPF DataTrigger
body: <p>I'm working on a board game to get a grip on WPF and I'm stuck after trying the whole night to get this part working.</p>
  
  <p>The following code belongs to the 'House' user control and works just fine on the designer. I can select the 'house' object and change the HouseType property on the property grid and see the desired effect. But in runtime, if I change the same property,  nothing happens! </p>
  
  <pre><code>&lt;DrawingBrush x:Key="emptyHouseBrush"&gt;
    &lt;DrawingBrush.Drawing&gt;
      &lt;GeometryDrawing Geometry="M0,0 100,100 M0,100 100,0"&gt;
        &lt;GeometryDrawing.Pen&gt;
          &lt;Pen Brush="Black" /&gt;
        &lt;/GeometryDrawing.Pen&gt;
      &lt;/GeometryDrawing&gt;
    &lt;/DrawingBrush.Drawing&gt;
  &lt;/DrawingBrush&gt;
  
  &lt;DataTemplate DataType="{x:Type m:House}"&gt;
    &lt;Border x:Name="border" BorderThickness="2"  &gt;
      &lt;Grid x:Name="grid" &gt;
  
      &lt;/Grid&gt;
    &lt;/Border&gt;      
    &lt;DataTemplate.Triggers&gt;
      &lt;DataTrigger Binding="{Binding Path=HouseType}" Value="Neutral"&gt;
        &lt;Setter TargetName="border" Property="BorderBrush" Value="Black"/&gt;
      &lt;/DataTrigger&gt;
      &lt;DataTrigger Binding="{Binding Path=HouseType}" Value="Forbidden"&gt;
        &lt;Setter TargetName="border" Property="BorderBrush" Value="Black"/&gt;
        &lt;Setter TargetName="grid" Property="Background" Value="{StaticResource ResourceKey=emptyHouseBrush}"/&gt;
      &lt;/DataTrigger&gt;
      &lt;DataTrigger Binding="{Binding Path=HouseType}" Value="Borders"&gt;
        &lt;Setter TargetName="border" Property="BorderBrush" Value="#FF7A6D34"/&gt;
      &lt;/DataTrigger&gt;
      &lt;DataTrigger Binding="{Binding Path=HouseType}" Value="Homeland"&gt;
        &lt;Setter TargetName="border" Property="BorderBrush" Value="#FFFFD200"/&gt;
        &lt;Setter TargetName="border" Property="Background" Value="#54FBE681"/&gt;
      &lt;/DataTrigger&gt;
  
      &lt;Trigger SourceName="border" Property="IsMouseOver" Value="True"&gt;
        &lt;Setter TargetName="border" Property="Background" Value="#645CAEF9"/&gt;
      &lt;/Trigger&gt;
  
    &lt;/DataTemplate.Triggers&gt;
  &lt;/DataTemplate&gt;
  
  
  &lt;/Control.Resources&gt;
    &lt;ContentControl&gt;
      &lt;m:House x:Name="house" HouseType="Neutral"&gt;&lt;/m:House&gt;
    &lt;/ContentControl&gt;
  
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>I have tried using default properties, dependency properties, implementing IPropertyChanged interface, tried moving the property to the control and repeating all of the above... and still nothing.</p>
  
  <p>What am I missing? How can I have the control update the border (and background) once I change this property?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Marcelo</p>