title: WPF Changing Controls within a data template?
body: <p>so now that I can access controls hidden within nested datatemplates, it seems that I cannot change their values. For instance I have the code (granted to me graciously by a Stack overflow member)</p>
  
  <pre><code>&lt;Grid Name="mainGrid"&gt;
      &lt;Grid.Resources&gt;
      &lt;DataTemplate x:Key="frontTemplate" &gt;
          &lt;StackPanel x:Name="noWork"&gt;
              &lt;Image Source="Images/1.png" Stretch="Fill" Width="72" Height="96" x:Name="FrontFace"   HorizontalAlignment="Left" VerticalAlignment="Top"&gt;&lt;/Image&gt;
          &lt;/StackPanel&gt;
      &lt;/DataTemplate&gt;
  
      &lt;DataTemplate x:Key="flipItemTemplate"&gt;
          &lt;Grid Width="200" Height="200"&gt;
  
              &lt;Border x:Name="frontHost" Background="Transparent"&gt;
                  &lt;ContentPresenter Name="contentPresenter"  Content="{Binding}" ContentTemplate="{StaticResource frontTemplate}" /&gt;
              &lt;/Border&gt;
          &lt;/Grid&gt;
      &lt;/DataTemplate&gt;
      &lt;/Grid.Resources&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>And although I can get TO the image in that second template (frontFace) I can't get the source to change. I can get a new bitmap, and load it without error, but the image does not change. If I put an image control in the XAML outside of the datatemplate and load it with my bitmap code there, it works fine. This leads me to believe that the template can't redraw itself after its been applied... BUT I can't get access to its internal elements until its been applied... so how in the heck do I dynamically set up elements in a template before its been applied?</p>