public static Task Shutdown() { return(Invoke(() => { if (ShuttingDown != null) { ShuttingDown(typeof(Windows), EventArgs.Empty); } if (IsMiniWindowCreated) { MiniWindow.Close(); } if (IsMainWindowCreated) { MainWindow.Close(); } if (IsSettingsWindowCreated) { SettingsWindow.Close(); } if (IsEqualizerWindowCreated) { EqualizerWindow.Close(); } if (IsTempoWindowCreated) { TempoWindow.Close(); } if (IsPlaylistManagerWindowCreated) { PlaylistManagerWindow.Close(); } UIBehaviour.Shutdown(); Reset(); })); }