I need to fade multiple Views out in parallel with each other. At the moment, I'm using the View.FadeTo
to fade the two views out right now. I'm doing it in an async void
method, and not awaiting the first View.FadeTo
and awaiting on the second one in order to let the first one start fading and wait for them both to finish.
private async void AuthorizationLevelChanged(bool? incomingValue, string propertyName)
{
if(!incomingValue.Value)
{
this.GuidanceLabel.FadeTo(0.0, 400, Easing.SinInOut);
await this.btnEnableAccess.FadeTo(0.0, 400, Easing.SinOut);
this.GuidanceLabel.Text = authorizationDeniedHelp;
this.btnEnableAccess.IsVisible = false;
this.GuidanceLabel.FadeTo(1.0, 400, Easing.CubicIn);
}
}
This feels a bit like a hack and I'd like to do it in a cleaner, better supported fashion. In a fashion that doesn't have me using the bad practice of not awaiting the awaitable calls, within an async method.
How can I animate multiple views at once like this? Is there a more manual way of doing it, that doesn't include the extension methods?