How to implement Async Command

前端 未结 4 1804
轻奢々
轻奢々 2021-02-19 16:02

Although I have understood async programming with c# somehow, still don\'t get why async with void is not the better solution, then when I want to improve my Xamarin Forms code

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-19 16:51

    There is nothing wrong with async void on a command execute handler providing you handle your exceptions.

    So what does an AsyncCommand, offer? Potentially the following

    • An error channel to pass back any unhandled exceptions

    • Not having to write async void or async lamdas

    • IsBusy framework, to stop things like double hits or what ever you can imagine

提交回复
热议问题