예제 #1
0
 private void SessionTimeoutAction()
 {
     MainViewModel.Instance.KioskApp.ClearVMData();
     _navigationStateViewModel = MainViewModel.Instance.KioskApp.SubViewModels.FirstOrDefault(
         vm => vm.NavigationStateViewModel.NextStep == StepOrder.Language).NavigationStateViewModel;
     NavigateForwardAction();
 }
예제 #2
0
        /*
         * private void SubscribeToEvents()
         * {
         *  MessagingCenter.Subscribe<EmailPromptViewModel>(this, "LeadMatchedPositiveID", (sender) =>
         *              {
         *      Device.BeginInvokeOnMainThread(() => LeadMatchedPositiveIDAction());
         *  });
         * }
         */

        private void LeadMatchedPositiveIDAction()
        {
            Debug.WriteLine("Lead has been found in CRM. Redirecting to Objectives Page");
            try
            {
                _navigationStateViewModel = MainViewModel.Instance.KioskApp.SubViewModels.FirstOrDefault(
                    vm => vm.NavigationStateViewModel.NextStep == StepOrder.Objective).NavigationStateViewModel;
                NavigateForwardAction();
            }
            catch
            {
                Debug.WriteLine("The lead may have been removed from database");
            }
        }
예제 #3
0
        private async void NavigateForwardAction()
        {
            InitState();  // THIS WILL BE CHANGED LATER - BAD PRACTICE

            MessagingCenter.Send(this, "ForwardArrowPressed");
            if (!_navigationStateViewModel.SubViewModel.IsValid)
            {
                return;
            }

            var nextSubViewModel = MainViewModel.Instance.KioskApp.SubViewModels.FirstOrDefault(
                vm => vm.NavigationStateViewModel.CurrentStep == _navigationStateViewModel.NextStep);

            if ((nextSubViewModel == null))
            {
                return;
            }
            _navigationStateViewModel = nextSubViewModel.NavigationStateViewModel;

            // SKIP CAMPUS PROMPT PAGE IF ONLY ONE CAMPUS OPTION
            if (NavigationStateViewModel.CurrentStep == StepOrder.Campus &&
                MainViewModel.Instance.KioskApp.SettingsVm.ChosenCampuses().Count == 1)
            {
                MainViewModel.Instance.KioskApp.CampusVm.CampusChosen =
                    MainViewModel.Instance.KioskApp.SettingsVm.ChosenCampuses().FirstOrDefault();
                return;
            }

            await Task.Run(() => UpdateNecessaryDataInViews());

            Navigation.NavigateToNextPage(_navigationStateViewModel);
            ShowReturnIcon = EvaluateReturnIconVisible();

            if (NavigationStateViewModel.CurrentStep != StepOrder.Acknowledgement)
            {
                return;
            }
            NavigationProcessTerminated();
        }
예제 #4
0
 protected SubViewModel()
 {
     _navigationStateViewModel             = new NavigationStateViewModel();
     NavigationStateViewModel.SubViewModel = this;
 }