RelayCommandAttribute.IncludeCancelCommand Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether a cancel command should also be generated for an asynchronous command.
When set to true
, this additional code will be generated:
partial class MyViewModel
{
private ICommand? loginUserCancelCommand;
public ICommand LoginUserCancelCommand => loginUserCancelCommand ??= LoginUserCommand.CreateCancelCommand();
}
Where LoginUserCommand
is an IAsyncRelayCommand defined in the class (or generated by this attribute as well).
public bool IncludeCancelCommand { get; init; }
member this.IncludeCancelCommand : bool with get, set
Public Property IncludeCancelCommand As Boolean
Property Value
Remarks
Using this property is not valid if the target command doesn't map to a cancellable asynchronous command.