After login I'm opening this Mainwindow
MainWindow window = new MainWindow();
and closing the Login window.
In the main window there is a windows form I'm initializing globally
Scanner form = new Scanner();
I'm hiding and showing this Scanner Winforms according to my need. I need to call a Mainwindow button click from Scanner.cs
If I try to do MainWindow window = new MainWindow();
from Scanner.cs it will create a new Mainwindow, which I don't want to do.
These are all the references I found.