Have done a lot of trawling and found some bits of info I needed, but still haven't quite worked out how to fit all the pieces together. I either get 1. errors that prevent build, 2. no message appearing, or 3. message appears but program continued on in the meantime regardless.
So, I want to ask a question of the user which relates to reloading info from their previous session (or start fresh). It should wait for this answer. I know I need async/await in there somewhere, and I also need the answer (as a boolean or string). I also have found I need Device.BeginInvokeOnMainThread and/or OnAppearing in order for the message to actually appear in the first place. Most examples I've seen revolve around tying it to a button click or other event, but I want this to run at the beginning, and not do anything else until I have the answer (since the loading of info on the first screen depends on the answer).
So, for DisplayAlert("Resume?","Do you want to reload your data from last session?","yes","no"), how do I wrap that up so that it appears upon start-up, and nothing happens until answered (so that I'm either reloading or reinitialising), and I can access that answer from elsewhere (i.e. stick the result in some kind of variable to be accessed by the rest of the code)? It's my first time using DisplayAlert, my first time using async/await,and first time using Device.BeginInvoke... - I keep tinkering with different variations but keep getting one of the 3 aforementioned results. :-(
await
– Sten Petrov