title: WPF Button content based on DataContext settings
body: <p>I'm working with WPF and MVVM pattern, I have a simple view which consists of a Button, which should display one thing or another depending on a property of the DataContext (viewmodel)
  I've used datatriggers and datatemplates to try make this work, but for some reason the binding is not evaluating (or i'm doing something wrong).</p>
  
  <pre><code>    &lt;Button x:Class="EpicNavalBattle.View.PositionView"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  
          &gt;
      &lt;Button.Resources&gt;
          &lt;DataTemplate x:Key="Hidden"&gt;
              &lt;Label Content="Hidden"&gt;&lt;/Label&gt;
          &lt;/DataTemplate&gt;
          &lt;DataTemplate x:Key="Shown"&gt;
              &lt;Label Content="{Binding Path=Content.ContentName}" /&gt;
          &lt;/DataTemplate&gt;
  
  
  
      &lt;/Button.Resources&gt;
      &lt;Button.Style&gt;
          &lt;Style TargetType="{x:Type Button}"&gt;
              &lt;Style.Triggers&gt;
                  &lt;DataTrigger Binding="{Binding Revealed}" Value="False"&gt;
                      &lt;Setter Property="ContentTemplate" Value="{DynamicResource Hidden}"&gt;&lt;/Setter&gt;
  
                  &lt;/DataTrigger&gt;
                  &lt;DataTrigger Binding="{Binding Revealed}" Value="True"&gt;
                      &lt;Setter Property="ContentTemplate" Value="{DynamicResource Shown}"&gt;&lt;/Setter&gt;
  
                  &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
  
      &lt;/Button.Style&gt;
  
  
  &lt;/Button&gt;
  </code></pre>
  
  <p>Just to avoid confusion : Content is a property of the ViewModel (inherited datacontext) that's basicly the Model class, and ContentName, a property of the Model class.
  The whole datatemplate IS evaluated, because to prove this, i changed the Content="Binding...." stuff for text, and it actually shows a button with the specified label inside.
  right now, what i see is just buttons with no text (small, minimum size)
  any help is appreciated (not only on how to solve this, but also on what i'm doing wrong here). thanks!</p>