Skip to content

CancelCommand.Wrap does not propagate IsCancelled information #30

@bitbonk

Description

@bitbonk

The current version CancelCommand.Wrap() does not propagate IsCancelled information to the Execution.IsCancelled of the parent AsyncCommand.

In the following code

public AsyncCommandsDemoViewModel(IDataClient dataClient)
{
    this.CancelGetData = new CancelCommand();
    this.GetData = new AsyncCommand(
        this.CancelGetData.Wrap(
            async cancellationToken =>
                this.Data = await dataClient.GetDataAsync(cancellationToken)));
}

if the CancelGetData command is executed, GetData.Execuction.IsCancelled never becomes true.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions