Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Why PushAsync and not just Push?

$
0
0

Hi, I am wondering: Why does Xamarin forms have PushAsync (etc) for its Navigation? Isn't pushing a new Page onto the navigation stack inherently a UI operation, and as such wouldn't you want that to be an synchronous operation performed on the main UI thread? Are there synchronous versions of these methods that I haven't yet found?

One frustrating thing about the async versions is that they swallow exceptions, so you must either await (causing a refactor, complicating your code) or add a ContinueWith (again, cluttering the code, and seemingly unnecessarily). Does anyone have a good explanation as to why they are asynchronous? Also, what tricks do you use in your code to catch the exceptions cleanly without cluttering your code too much?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>