title: Silverlight 2 - DataContext / Binding problem
body: <p>I'm having a problem with this this XAML...  When I run it, it hangs because of the TextBox. (By "hangs" I mean that the hosting aspx page shows in the browser, but the usercontrol object will not appear on the page, and there are some little green bars in the bottom of the Internet Explorer window that fill up but never go away.)  I have both a TextBox and a TextBlock in my code just for testing. It runs fine if I comment out the TextBox and leave only the TextBlock, so I know the DataContext is getting set and the binding to PatternName does work. There are no errors in the Output window to help me debug.  Please help! I've spent hours on this problem. What can possible be happening?</p>
  
  <pre><code>    &lt;StackPanel x:Name="HolePatternStackPanel" &gt;
              &lt;TextBlock Text="{Binding PatternName}" Width="75" /&gt;
              &lt;TextBox Text="{Binding PatternName}" Height="25" Width="125"/&gt;
       &lt;/StackPanel&gt;
  </code></pre>
  
  <p>Here is the code that sets the DataContext from a calling ListBox.SelectionChanged method:</p>
  
  <pre><code>private void lvHolePatterns_SelectionChanged(object sender, SelectionChangedEventArgs e)
  {
      HolePatternStackPanel.DataContext = this.ActivePattern;
  }
  </code></pre>