 isPrimaryButton: true,
                    autoFocus: true,
                    isVisible: true,
                    disableControl: ko.pureComputed(() => {
                        return this.processingFlag();
                    }),
                    buttonClickHandler: (() => {
                        this.onCancel();
                    }),
                }
            ];
        }

        onCancel() {
            if (!this.processingFlag()) {
                this.processingFlag(true);
                // Error page is shown, exit CXH with cancel appresult.
                bridge.invoke("CloudExperienceHost.cancel");
            }   
        }

        startVoiceOver() {
            // Setup voiceover and speech recognition
            try {
                CloudExperienceHostAPI.Speech.SpeechRecognition.stop();
                let constraints = this.createSpeechRecognitionConstraints();
                if (constraints && (constraints.length > 0)) {
                    CloudExperienceHostAPI.Speech.SpeechRecognition.promptForCommandsAsync(this.voiceOver, constraints).done((result) => {
                        this.onSpeechRecognitionResult(result);
                    });
                }
            }
            catch (err) {
                require(['legacy/core'], (core) => {
                    bridge.invoke("CloudExperienceHost.Telemetry.logEvent", "SpeechErrorPageFailure: ", core.GetJsonFromError(err));
                });
            }
        }

        createSpeechRecognitionConstraints() {
            let okConstraint = new Windows.Media.SpeechRecognition.SpeechRecognitionListConstraint(new Array(this.resourceStrings.OkConstraint));
            okConstraint.tag = okTag;
            let constraints = [okConstraint];
            return constraints;
        }

        onSpeechRecognitionResult(result) {
            if (result && !this.processingFlag() && result.constraint.tag == okTag) {
                this.onCancel();
            }
        }

    }
    return SsprErrorViewModel;
});