I have a question about the iOS designer - specifically, best practices for using async/await with the event stubs that the designer creates.
For example - I add a button in iOS designer to my view and double click it - it creates the TouchUpInside 'event' in my code behind. What do I do if inside that event, I want to call one of my async methods? In windows world, I would mark the Click event as async, so I can await my calls - but I can't seem to get it to work in Xamarin.
So, this is the code that iOS Designer generates:
partial void btnTemp_TouchUpInside (UIButton sender)
{
await this.Logoff(); //Obviously this isn't going to work
}
In Windows world I would do something like the following (not quite the same as the event is protected override in Winforms):
partial async void btnTemp_TouchUpInside (UIButton sender)
{
await this.Logoff();
}
but Xamarin won't let me do this (assuming it's because it's partial method?), even if I also edit the code in the designer.cs file
So, what's the scoop for doing this in Xamarin? Is this still being worked on? Is it something that's never going to be supported Visual Studio style out of the box due to some sort of limitation of the platform?
Any guidance would be appreciated.
Thanks as ever - loving exploring this platform even though it's sometimes making me feel like a junior programmer again!