private void Apply()
        {
            if (NewPin?.Length != 6)
            {
                ErrorMessage = "Your pin code must be 6 characters.";
                return;
            }
            if (NewPin != ReEnterNewPin)
            {
                ErrorMessage = "Pins do not match, please retype.";
                return;
            }
            Backend.Commands cmd = new Backend.Commands();
            int res = cmd.SetPin(NewPin);

            NewPin        = null;
            ReEnterNewPin = null;
            ErrorOK();
            switch (res)
            {
            case 1:
                //  SecurityManager.DisablePersonalPin();
                ErrorMessage        = null;
                Parent.IsPinEnabled = true;
                AllSet = true;
                break;

            default:
                ErrorMessage = "Something went wrong!";
                break;
            }
        }
        private void SubmitPersonalPin()
        {
            Commands cmd = new Backend.Commands();
            var      pinVerificationResult = cmd.SetPin(PersonalPin);

            PersonalPin             = null;
            PersonalPinErrorMessage = null;
            if (pinVerificationResult == 1)
            {
                HIOStaticValues.tmain.IsPinRequired = false;
                ShowResetPersonalPin = false;
                if (SetupWizard != null)
                {
                    SetupWizard.MoveNextPage();
                }
                OnSubmit?.Invoke(this, EventArgs.Empty);
            }
            else
            {
                HIOStaticValues.tmain.IsPinRequired = true;
                PersonalPinErrorMessage             = "Wrong pincode";
                switch (pinVerificationResult)
                {
                case 0:
                    PinLockEnd = null;
                    break;

                case -1:
                    PinLockEnd = DateTime.Now.AddMinutes(1);
                    break;

                case -2:
                    PinLockEnd = DateTime.Now.AddMinutes(5);
                    break;

                case -3:
                    PinLockEnd = DateTime.Now.AddMinutes(10);
                    break;

                case -4:
                    PinLockEnd = DateTime.Now.AddHours(1);
                    break;

                default:
                    PersonalPinErrorMessage = null;
                    SetPersonalPinFooterErrorMessage("Something went wrong!");
                    HIOStaticValues.PinInputDashboardVM?.OnPropertyChanged(nameof(PersonalPinFooterErrorMessage));
                    HIOStaticValues.PinInputExtensionVM?.OnPropertyChanged(nameof(PersonalPinFooterErrorMessage));
                    PinLockEnd = null;
                    break;
                }
            }
        }