Skip to content

Commit 5afbbdf

Browse files
committed
Improve XML docs for ICommandAttribute.IncludeCancelCommand
1 parent 86d689c commit 5afbbdf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CommunityToolkit.Mvvm/Input/Attributes/ICommandAttribute.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ public sealed class ICommandAttribute : Attribute
8383

8484
/// <summary>
8585
/// Gets or sets a value indicating whether a cancel command should also be generated for an asynchronous command.
86+
/// <para>
87+
/// When set to <see langword="true"/>, this additional code will be generated:
88+
/// <code>
89+
/// partial class MyViewModel
90+
/// {
91+
/// private ICommand? loginUserCancelCommand;
92+
///
93+
/// public ICommand LoginUserCancelCommand => loginUserCancelCommand ??= LoginUserCommand.CreateCancelCommand();
94+
/// }
95+
/// </code>
96+
/// Where <c>LoginUserCommand</c> is an <see cref="IAsyncRelayCommand"/> defined in the class (or generated by this attribute as well).
97+
/// </para>
8698
/// </summary>
8799
/// <remarks>Using this property is not valid if the target command doesn't map to a cancellable asynchronous command.</remarks>
88100
public bool IncludeCancelCommand { get; init; }

0 commit comments

Comments
 (0)