Hello Everyone,
I am pretty new in WPF C#. I am held up with an Issue.
ISSUE:
Lets say i have a MainWindow.xaml, and have the Main program logic in it.
I have a second Window called Second.xaml
I am calling Second.xaml in MainWindow.xaml.cs,
currently I am doing:
MainWindow.xaml.cs:
var wind = new Second(); wind.Show();
This successfully opens the Second Window, In second Window I have few buttons,
My motive is to trigger events in MainWindow using Second.xaml.cs
(i.e)
in Second.xaml.cs:
....
..
MainWindow mainwindowID = new MainWindow();
;
....
..
.
private void nextButton_Click(object sender, RoutedEventArgs e)
{
mainwindowID.textBox.Content = "Displaying In Mainwindow";
}If I click the Next button in Second.xaml I want the text Box inside Mainwindow to be updated.
Though the program in running, nothing changes inside MainWindow.
Stuck up with this, please help me.
Kindly let me know if you dont undersand what i am trying to say, i hope I didn't confuse ;)