private async Task TrySignIn() { try { bool success = await ViewModel.SignInAsync(); if (success) { Analytics.TrackEvent("Sign in success"); ((App)Application.Current).NavigateToFirstPage(arguments, true); } } catch (BackendAuthenticationFailedException) { Analytics.TrackEvent("Sign in failed"); var shakeAnimation = Window.Current.Compositor.CreateVector3KeyFrameAnimation(); shakeAnimation.InsertKeyFrame(0.125f, new Vector3(-10.0f, 0.0f, 0.0f)); shakeAnimation.InsertKeyFrame(0.375f, new Vector3(010.0f, 0.0f, 0.0f)); shakeAnimation.InsertKeyFrame(0.625f, new Vector3(-10.0f, 0.0f, 0.0f)); shakeAnimation.InsertKeyFrame(0.875f, new Vector3(010.0f, 0.0f, 0.0f)); shakeAnimation.InsertKeyFrame(1.000f, new Vector3(000.0f, 0.0f, 0.0f)); shakeAnimation.Duration = TimeSpan.FromMilliseconds(500); shakeAnimation.Target = "Translation"; SignInButton.StartAnimation(shakeAnimation); } }