From 4e40b89fbb36a3ec6b4240d995197f21927756bf Mon Sep 17 00:00:00 2001 From: Lesueur Benjamin Date: Sat, 6 Jul 2024 17:52:38 +0200 Subject: [PATCH] fixed an issue preventing profile delete button from being enabled --- HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs b/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs index f915cf259..f51d0ae1e 100644 --- a/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs +++ b/HandheldCompanion/Views/Pages/ProfilesPage.xaml.cs @@ -526,8 +526,9 @@ private void UpdateUI() Application.Current.Dispatcher.Invoke(() => { // disable delete button if is default profile or any sub profile is running - b_DeleteProfile.IsEnabled = !selectedProfile.ErrorCode.HasFlag(ProfileErrorCode.Default & ProfileErrorCode.Running); //TODO consider sub profiles pertaining to this main profile is running - // prevent user from renaming default profile + //TODO consider sub profiles pertaining to this main profile is running + b_DeleteProfile.IsEnabled = (selectedProfile.ErrorCode & (ProfileErrorCode.Default | ProfileErrorCode.Running)) == 0; + // prevent user from renaming default profile b_ProfileRename.IsEnabled = !selectedMainProfile.Default; // prevent user from disabling default profile Toggle_EnableProfile.IsEnabled = !selectedProfile.Default;