Friday, May 8, 2015

How to refresh Form1 from inside a class?

If you new up Class1 from Form1 you can do:

Class1 MyInstance = new Class1(this);

You need the constructor of Class1 to take a Window:


public Class1 ( Form CallerForm)
{ }

Then you can make that CallerForm ( which is Form1 ) do stuff.

If these are totally disconnected bits of code ( seems a bit unlikely ) you could use this technique:

http://ift.tt/1IUOFIK


Hope that helps.

Technet articles: Uneventful MVVM; All my Technet Articles

No comments:

Post a Comment