This project is read-only.

Password Input - Keep showing if wrong password entered

Mar 6, 2014 at 8:18 AM
Hi, I would like to keep the password input showing if the user enters a wrong password.

e.g. In the "Completed" event if I try the following, it does not work:
            if (!string.IsNullOrWhiteSpace(passwordInput.Value))
                textblk.Text = passwordInput.Value; //Do Something...
                passwordInput.Show();  //Does not Work.
How to achieve this?

Mar 6, 2014 at 10:16 PM
Right away, I'm betting you'll need a new password prompt. Reusing existing prompts is not supported. I'm betting your getting an exception thrown here.

If this isn't the case, can you create a bug with a simple repro so I can verify what exactly is going on with a debugger?
Mar 7, 2014 at 9:51 AM
You are right - reusing the prompt is not supported. I was not getting any exception just that the prompt was closing and the "else" part was not showing the prompt again.

I posted this in StackOverflow website and I was advised to override the OnCompleted event. In the Overridden event firstly add a check for a blank password and if the password is not blank then call the OnCompleted of the Base class.

Following is the link for the solution: HERE

Just a suggestion - Maybe this functionality can be incorporated in the control itself since blank passwords won't be allowed anyways. Or a property "AllowBlankPassword" can be created.
Mar 7, 2014 at 7:41 PM
Controls provide a framework, having a property like that implies the control should be in the business of displaying error codes which is a huge question of how to properly do it.