mvvmcatel

Catel CancelAndCloseView repalced in version 4.3


In Catel 4.3 is the CancelAndCloseViewModel() obsolete.

I have to use the AsynchronousCommand instead.

So in constructor

CmdCancel = new AsynchronousCommand(OnCancel, () => !CmdCancel.IsExecuting)

private void OnCancel
{
  ??????
}

Then what?

Kind regards

Jeroen


Solution

  • Use TaskCommand and use the async methods:

    var cancelCommand = new TaskCommand(OnCancelExecuteAsync);
    
    public async Task OnCancelExecuteAsync()
    {
        await this.CancelAndCloseViewModel();
    }