mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02: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:
@@ -35,12 +35,14 @@ namespace Wox.Plugin.SystemPlugins.Program
|
|||||||
private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e)
|
private void btnDeleteProgramSource_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource;
|
ProgramSource seletedProgramSource = programSourceView.SelectedItem as ProgramSource;
|
||||||
if (seletedProgramSource != null &&
|
if (seletedProgramSource != null)
|
||||||
MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource",
|
|
||||||
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
|
||||||
{
|
{
|
||||||
UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource);
|
if (MessageBox.Show("Are your sure to delete " + seletedProgramSource.ToString(), "Delete ProgramSource",
|
||||||
programSourceView.Items.Refresh();
|
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
UserSettingStorage.Instance.ProgramSources.Remove(seletedProgramSource);
|
||||||
|
programSourceView.Items.Refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user