I have this class:
public partial class Window1 : Window
{
public String Name2;
public Window1()
{
InitializeComponent();
Name2 = new String('a', 5);
myGrid.DataContext = this;
}
And I want to display the string Name2 is a textbox.
<Grid Name="myGrid" Height="437.274">
<TextBox Text="{Binding Path=Name2}"/>
</Grid>
But it isn't display the string. Also, if the string Name2 is updated periodically using a TimerCallback, do I need to do anything to make sure the TextBox is updated when the data changes?
Thanks!