// performs an animated transition between the signup and login controls, or vice-versa private async Task TransitionToMode(LoginViewModel.Modes mode) { var outgoingControls = mode == LoginViewModel.Modes.Login ? SignupControls : LoginControls; var incomingControls = mode == LoginViewModel.Modes.Signup ? SignupControls : LoginControls; await Task.WhenAll(AvatarImage.FadeTo(0), outgoingControls.FadeTo(0)); outgoingControls.IsVisible = false; incomingControls.Opacity = 0; incomingControls.IsVisible = true; Title = ViewModel.TitleForMode; await Task.WhenAll(AvatarImage.FadeTo(1), incomingControls.FadeTo(1)); }