diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index 00d1098..0524989 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -1166,18 +1166,24 @@ Suspend support not enabled.", true); filename = profileListHolder.ProfileListCol[idx].Name; dupBox.OldFilename = filename; dupBoxBar.Visibility = Visibility.Visible; - dupBox.Save += (sender2, profilename) => - { - profileListHolder.AddProfileSort(profilename); - dupBoxBar.Visibility = Visibility.Collapsed; - }; - dupBox.Cancel += (sender2, args) => - { - dupBoxBar.Visibility = Visibility.Collapsed; - }; + 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); + dupBoxBar.Visibility = Visibility.Collapsed; + } + private void DeleteProfBtn_Click(object sender, RoutedEventArgs e) { if (profilesListBox.SelectedIndex >= 0)