I need to access a control in XAML from a different class e.g. a text box called myTextBox. This is what I did but got an error:
Windows1 w = new Windows1();
w.myTextBox.text = "Hello!";
However, I'm getting an error message as:
'Set property 'System.Windows.Controls.ContentControl.Content' threw an exception.
The sticky error points to
<Grid Margin="10">
<Grid.RowDefinitions> <!-- error points to this line -->
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
Please give me some direction to find the reason or error.
Thanks, Amit