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?
<StackPanel x:Name="HolePatternStackPanel" >
<TextBlock Text="{Binding PatternName}" Width="75" />
<TextBox Text="{Binding PatternName}" Height="25" Width="125"/>
</StackPanel>
Here is the code that sets the DataContext from a calling ListBox.SelectionChanged method:
private void lvHolePatterns_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
HolePatternStackPanel.DataContext = this.ActivePattern;
}