diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index e90a53fc3..a5c9f3afe 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -70,7 +70,7 @@ namespace Flow.Launcher public void RestarApp() => RestartApp(); - public void ShowMainWindow() => _mainVM.MainWindowVisibility = Visibility.Visible; + public void ShowMainWindow() => _mainVM.Show(); public void CheckForNewUpdate() => _settingsVM.UpdateApp(); diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 054274eb6..88d4f2895 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -15,7 +15,6 @@ using Flow.Launcher.ViewModel; using Flow.Launcher.Helper; using System.Windows.Controls; using Flow.Launcher.Core.ExternalPlugins; -using Screen = System.Windows.Forms.Screen; namespace Flow.Launcher { diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 6e1befeaf..9870053c2 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -713,16 +713,7 @@ namespace Flow.Launcher.ViewModel { if (WinToggleStatus != true) { - if (_settings.UseSound) - { - MediaPlayer media = new MediaPlayer(); - media.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); - media.Play(); - } - MainWindowVisibility = Visibility.Visible; - WinToggleStatus = true; - ((MainWindow)Application.Current.MainWindow).WindowAnimator(); - MainWindowOpacity = 1; + Show(); } else { @@ -730,6 +721,20 @@ namespace Flow.Launcher.ViewModel } } + public void Show() + { + if (_settings.UseSound) + { + MediaPlayer media = new MediaPlayer(); + media.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); + media.Play(); + } + MainWindowVisibility = Visibility.Visible; + WinToggleStatus = true; + ((MainWindow)Application.Current.MainWindow).WindowAnimator(); + MainWindowOpacity = 1; + } + public async void Hide() { MainWindowOpacity = 0;