Reputation: 10865
I have this code in my MainWindow.xaml.cs
Page2 myPage = new Page2();
myPage.ShowData();
Basically, it should implement the function from another class since the function is declared as public and should be accessed by another class, but when I try to execute it it doesn't do anything. It hits the breakpoint but the function is not executed.
In my Page2.xaml.cs I have,
public void ShowData() { textBox1.Text = "Test"; }
Upvotes: 0
Views: 120
Reputation: 1447
Check whether invocation is required by calling textBox1.InvokeRequired
. If that value is true
, you've to call textBox1.Invoke([Delegate function]);
Upvotes: 1