Make sure to unsubscribe from events for DupBox

Related to issue #1073
This commit is contained in:
Travis Nickles 2020-01-25 20:33:45 -06:00
parent 9a92beff3a
commit 88081faba8

View File

@ -1166,16 +1166,22 @@ Suspend support not enabled.", true);
filename = profileListHolder.ProfileListCol[idx].Name; filename = profileListHolder.ProfileListCol[idx].Name;
dupBox.OldFilename = filename; dupBox.OldFilename = filename;
dupBoxBar.Visibility = Visibility.Visible; dupBoxBar.Visibility = Visibility.Visible;
dupBox.Save += (sender2, profilename) => dupBox.Save -= DupBox_Save;
dupBox.Cancel -= DupBox_Cancel;
dupBox.Save += DupBox_Save;
dupBox.Cancel += DupBox_Cancel;
}
}
private void DupBox_Cancel(object sender, EventArgs e)
{
dupBoxBar.Visibility = Visibility.Collapsed;
}
private void DupBox_Save(DupBox sender, string profilename)
{ {
profileListHolder.AddProfileSort(profilename); profileListHolder.AddProfileSort(profilename);
dupBoxBar.Visibility = Visibility.Collapsed; dupBoxBar.Visibility = Visibility.Collapsed;
};
dupBox.Cancel += (sender2, args) =>
{
dupBoxBar.Visibility = Visibility.Collapsed;
};
}
} }
private void DeleteProfBtn_Click(object sender, RoutedEventArgs e) private void DeleteProfBtn_Click(object sender, RoutedEventArgs e)