How to make the same thing on WinForms, that I have in WPF application (Application.Current.Dispatcher.Invoke((Action)delegate):
public class Fullscreen
{
public Fullscreen(Action goFullScreen)
{
goFullScreenMode = goFullScreen;
}
public void Make()
{
Application.Current.Dispatcher.Invoke((Action)delegate
{
goFullScreenMode();
});
}
}
I need to access to MainWindow.cs in WinForms that сontains:
public void GoFullScreen()
{
TopMost = true;
FormBorderStyle = FormBorderStyle.None;
WindowState = FormWindowState.Maximized;
}
That I register like this in MainWindow_Load
_fullscreen = new Fullscreen(GoFullScreen);
RegisterJavaScriptObject("__fullscreen", _fullscreen);