title: DataTrigger Overflow exception
body: <p>How can this be an overflow exception...?</p>
  
  <pre><code>&lt;DataTemplate x:Key="ElementTemplate"&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
                  &lt;StackPanel.Style&gt;
                      &lt;Style TargetType="{x:Type StackPanel}"&gt;
                          &lt;Style.Triggers&gt;
                              &lt;DataTrigger Binding="{Binding Converter={StaticResource TypeConv}}" Value="{x:Type models:GroupModel}"&gt;
                                  &lt;Setter Property="Margin" Value="5 0 0 0"&gt;&lt;/Setter&gt;
                                  &lt;Setter Property="DataContext" Value="{Binding Model}"&gt;&lt;/Setter&gt;
                              &lt;/DataTrigger&gt;
                          &lt;/Style.Triggers&gt;
                      &lt;/Style&gt;
                  &lt;/StackPanel.Style&gt;
                  &lt;TextBlock Text="{Binding Name}"&gt;&lt;/TextBlock&gt;
                  ...
               &lt;StackPanel/&gt;
  &lt;DataTemplate/&gt;
  </code></pre>
  
  <p>For the reason: this is a template (with at least 25 UI contros) that normally needs Model A as datatype. the <code>DataTemplate</code> is a <code>ListvVew</code> <code>ItemTemplate</code>. But the datatype can be of type Model B. Model B has a property called 'Model', which is of type Model A.
  So instead of copy pasting the whole block template and use style triggers or <code>DataTemplate</code> selectors, I just want to change the <code>DataContex</code>t (from "{Binding}" to "{Binding Model}")</p>
  
  <p>anyone has some suggestions, a solution?</p>
  
  <p>Thx!</p>
  
  <p>EDIT: the <code>Converter</code> returns the type of the incoming value (the data object itself). that way i can know when Model B is using the template and so to change the DataContext. </p>