From b91850262dca5ad4710eaa0ed52d429484ce5c07 Mon Sep 17 00:00:00 2001 From: Coenraad Stijne Date: Thu, 10 Jul 2014 17:06:50 +0200 Subject: [PATCH] [Programs] Fix MessageBox behaviour Fix MessageBox asking user to select item if he clicks No after trying to Delete an item in Programs Settings. --- .../Program/ProgramSetting.xaml.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs b/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs index 04c9d9c036..6fa388a6f0 100644 --- a/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs +++ b/Wox.Plugin.SystemPlugins/Program/ProgramSetting.xaml.cs @@ -35,12 +35,14 @@ namespace Wox.Plugin.SystemPlugins.Program private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e) { ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource; - if (seletedProgramSource != null && - MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource", - MessageBoxButton.YesNo) == MessageBoxResult.Yes) + if (seletedProgramSource != null) { - UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource); - programSourceView.Items.Refresh(); + if (MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource", + MessageBoxButton.YesNo) == MessageBoxResult.Yes) + { + UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource); + programSourceView.Items.Refresh(); + } } else {