I am trying to call this method from another class.
public void minimize()
{
System.Windows.Application.Current.Dispatcher.Invoke(new Action(() =>
{
var min = new MainWindow();
min.WindowState = WindowState.Minimized;
}));
}
But I get this error:
Member 'FormWindowState.Minimized' cannot be accessed with an instance reference; Qualify it with a type name instead
How can I solve the issue?