I have a bunch of textboxes on a XAML page that I wanted the same size. I created a control template and put it in the Grid.Resources section of the page
<Grid.Resources>
<ControlTemplate x:Key="basicTextbox" TargetType="TextBox" >
<TextBox MinWidth="200" />
</ControlTemplate>
</Grid.Resources>
and I apply it to a textbox like the following:
<TextBox x:Name="txtNewSec1" Template="{StaticResource basicTextbox}"/>
I have a button that a user can press and in the code behind I take the text the user has entered and apply it to an object. I was surprised everytime when the text would come back blank when text was in the textbox. After removing the template from the textbox and clicking the button again, the text is magically available during the button's click event handler. Is there something I have to set in the ControlTemplate to allow the textbox to have text during code-behind events? Or is this some sort of bug in Silverlight?