mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 19:19:23 +08:00
[Programs] Fix MessageBox behaviour
Fix MessageBox asking user to select item if he clicks No after trying to Delete an item in Programs Settings.
This commit is contained in:
parent
ed2dc101bb
commit
b91850262d
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user