public static void SetMainWindowSizeSmall() { MainWindow window = Resources.FindObjectsOfTypeAll(typeof(MainWindow))[0] as MainWindow; window.window.position = new Rect(0f, 0f, 762f, 600f); }