When building UWP apps, a chain of Async methods is inevitable and invariably ends up at the UWP MainPage constructor or another synchronous method.
The compiler will warn you that an await operator can only be used in an async method, leaving out the await will also warn you that because the call s not awaited, execution of the current method continues before the call is completed. So the developer is left in a quandary.
In my case, I can get round this by placing async methods in the Loaded event of the main page and making it async, but what if this was not possible, what then?
For example I have a method that initializes a mainpage treeview control with StorageFolder items. I have added the Async keyword to my MainPage Loaded event handler which returns void.
So what I am asking is: how do you end an async chain of methods in a UWP or WPF app?
There are lots of examples that illustrate the async/await process when running in a console app, but I cannot find a good example the illustrates this for a uwp app, that is using async/await on the UI thread, (handing controls for example like treeview or gridview).