Catel 的 AsynchronousCommand 正确用法

Catel's AsynchronousCommand correct usage

我必须使用命令调用异步任务。我认为 AsynchronousCommand 可以解决问题,但它接受 Action 作为方法,所以我必须使用 as

public async void Something(object args)

是否应该接受命令定义的任务?

更新 #1

按照@Geert 的建议使用了 TaskCommand

Async void 非常糟糕,因为它不能被等待(这意味着你会导致很多问题)。使用 async Task ExecuteAsyncvoid Execute.