I'm trying to make animation on a View through its ViewModel, but it doesn't working somehow. If call explicitly an animation in the View, it works but not from the attached ViewModel. Right now I resolve the control from the Autofac's componentcontext which is a single instance.
The code looks like this:
Device.BeginInvokeOnMainThread(async () =>
{
var internetConnectionView = componentContext.Resolve<InternetConnectionControl>();
await internetConnectionView.FadeTo(0, 2000, Easing.Linear);
await internetConnectionView.FadeTo(1, 2000, Easing.Linear);
await internetConnectionView.FadeTo(0, 2000, Easing.Linear);
});
What can be the problem?