示例#1
0
        public FailureFeedbackScreenViewModel(DataStorage data, IdleTimeoutTimer timer, Settings settings, MainPageMasterViewModel mainViewModel) : base(timer, settings)
        {
            this.MainViewModel = mainViewModel;
            this.DataStore     = data;
            this.FailureFeedbackSelectCommand = new Command(async p =>
            {
                if (p is string)
                {
                    var failureReason = p as string;
                    if (failureReason == OtherLabel)
                    {
                        // TODO Change this once adding multiple text entry screens
                        await this.NavService.NavigateTo(EnabledScreens.GetNextScreen(this)).ConfigureAwait(false);
                    }
                    else
                    {
                        await this.GetFailureReasonAsync(failureReason).ConfigureAwait(false);
                    }
                }
            });

            var ButtonList = this.Settings.ListFailureReasons.Trim().Split(';');

            this.AvailableButtons = new List <ButtonItem>();
            foreach (string element in ButtonList)
            {
                this.AvailableButtons.Add(new ButtonItem(element, this.FailureFeedbackSelectCommand, Color.FromHex(Settings.ColorStandardButton)));
            }
            if (Settings.BoolCustomInputScreenEnabled)
            {
                //this.AvailableButtons.Add(new ButtonItem(OtherLabel, this.FailureFeedbackSelectCommand, Color.FromHex(Settings.ColorStandardButton)));
            }
        }
示例#2
0
        public FailureFeedbackScreenViewModel(DataStorage data, IdleTimeoutTimer timer, Settings settings) : base(timer, settings)
        {
            this.DataStore = data;
            this.FailureFeedbackSelectCommand = new Command(p =>
            {
                var temp = p as string;
                if (temp != null)
                {
                    if (temp == OtherLabel)
                    {
                        // TODO Change this once adding multiple text entry screens
                        this.NavService.NavigateTo(EnabledScreens.GetNextScreen(this));
                    }
                    else
                    {
                        this.GetFailureReason(temp);
                    }
                }
            });

            var ButtonList = this.Settings.ListFailureReasons.Trim().Split(';');

            this.AvailableButtons = new List <IButtonListItem <Button> >();
            foreach (string element in ButtonList)
            {
                this.AvailableButtons.Add(new ButtonListItem <Button>(element, this.FailureFeedbackSelectCommand, Color.FromHex(Settings.ColorStandardButton)));
            }
            if (Settings.BoolCustomInputScreenEnabled)
            {
                this.AvailableButtons.Add(new ButtonListItem <Button>(OtherLabel, this.FailureFeedbackSelectCommand, Color.FromHex(Settings.ColorStandardButton)));
            }
        }
示例#3
0
 private void CompletePage()
 {
     if (!NavigationInProcess) // This prevents the double call to navigation services
     {
         this.NavService.NavigateTo(EnabledScreens.GetNextScreen(this));
         //this.NavService.NavigateTo(typeof(ScanRequestedScreenViewModel));
         this.NavigationInProcess = true;
     }
 }