Ejemplo n.º 1
0
        void RegisterEvents()
        {
            ViewModel.PropertyChanged += async(sender, e) =>
            {
                switch (e.PropertyName)
                {
                case "MoveToTwo":
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        ViewModel.EmailAddress = string.Empty;
                        mainInnerStack?.Children.RemoveAt(1);
                        mainInnerStack?.Children.Add(AccountDetails.GenerateAccountDetails(titleBar, ViewModel));
                    });
                    break;

                case "MoveToThree":
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        mainInnerStack?.Children.RemoveAt(1);
                        mainInnerStack?.Children.Add(SetPasswordDetails.GeneratePasswordDetails(titleBar, ViewModel));
                    });
                    break;

                case "MoveToFour":
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        mainInnerStack?.Children.RemoveAt(1);
                        mainInnerStack?.Children.Add(FleetDetails.GenerateFleetDetails(titleBar, ViewModel));
                    });
                    break;

                case "AllDone":
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        mainInnerStack?.Children.RemoveAt(1);
                        mainInnerStack?.Children.Add(SignupCompleted.SignupDetailsCompleted(titleBar, ViewModel));
                    });
                    break;

                case "MoveToPairing":
                    await Navigation.PushAsync(new PairNewVehiclePage());

                    break;
                }
            };
        }