protected async override void OnAppearing() { base.OnAppearing(); // fetch the demo credentials await ViewModel.LoadDemoCredentials(); // pause for a moment before animations await Task.Delay(App.AnimationSpeed); // Sequentially animate the login buttons. ScaleTo() makes them "grow" from a singularity to the full button size. await SignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); await SkipSignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); // Using Task.WhenAll() allows these two animations to be run in parallel. await Task.WhenAll(new [] { // FadeTo() modifies the Opacity property of the given VisualElements over a given duration. XamarinLogo.FadeTo(1, (uint)App.AnimationSpeed, Easing.SinIn), InfoButton.FadeTo(1, (uint)App.AnimationSpeed, Easing.SinIn) }); Insights.Track(InsightsReportingConstants.PAGE_SPLASH); }
protected async override void OnAppearing() { base.OnAppearing(); // fetch the demo credentials await ViewModel.LoadDemoCredentials(); // pause for a moment before animations await Task.Delay(App.AnimationSpeed); // Sequentially animate the login buttons. ScaleTo() makes them "grow" from a singularity to the full button size. await SignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); await SkipSignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); }
/// <summary> /// When App first appears We use the ViewModel property Located in ModelBoundContentPage<SplashViewModel> /// This SplashPage inherits from an abstract class SplashPageXaml : ModelBoundContentPage<SplashViewModel> /// on the bottom of this file. It is declared as SplashPage : SplashPageXaml /// </summary> protected async override void OnAppearing() { base.OnAppearing(); // Get sample credentials from SplashViewModel await ViewModel.LoadCredentials(); // Simulate login using animation await Task.Delay(App.AnimationSpeed); // Animate login buttons await SignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); await SkipSignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); }