public void MinimizeWindow() { // Handle the multiple minimize options switch (Config.Minimize) { // Just hide the window to effectively minimize to the tray case MinimizeOption.Tray: { IsWindowVisible = false; break; } // Set the window state to minimize to the taskbar case MinimizeOption.Taskbar: { WindowState = WindowState.Minimized; break; } // Set the minimized height of the window case MinimizeOption.Height: { // Set the current window settings Config.WindowSettingsOriginal = WindowSettings.Copy(); // Set the width and height to zero, which will be bounded by the window min size WindowWidth = 0; WindowHeight = 0; // Set the flag, to flip the button IsHeightMinimized = true; break; } default: throw new ArgumentOutOfRangeException(); } }