Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Add null conditional operator into SwipeItemView OnCommandCanExecuteC…
Browse files Browse the repository at this point in the history
…hanged method (#15869)

Co-authored-by: Federico Nembrini <25205086+FedericoNembrini@users.noreply.github.com>
  • Loading branch information
jfversluis and FedericoNembrini committed Feb 29, 2024
1 parent 7114bf3 commit 7dc1fb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Xamarin.Forms.Core/SwipeItemView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void OnCommandParameterChanged()

void OnCommandCanExecuteChanged(object sender, EventArgs eventArgs)
{
IsEnabled = Command.CanExecute(CommandParameter);
IsEnabled = Command?.CanExecute(CommandParameter) ?? true;
}
}
}
}

0 comments on commit 7dc1fb7

Please sign in to comment.