I am developing a Windows Phone 7.1 App and using PasswordInputPrompt
control in Coding4fun library.
I initialize the control and add an EventHandler for the Completed
event and then display the control.
PasswordInputPrompt passwordInput = new PasswordInputPrompt
{
Title = "Application Password",
Message = "Please Enter App Password",
};
passwordInput.Completed += Pwd_Entered;
passwordInput.Show();
In the Completed
event handler I check if the password is blank and if so then I would like to keep the prompt displaying.
void Pwd_Entered(object sender, PopUpEventArgs<string, PopUpResult> e)
{
if (!string.IsNullOrWhiteSpace(passwordInput.Value))
{
//Do something
}
else
{
passwordInput.Show(); //This is not working. Is this the correct way???
}
}
The else
part is not working. The prompt closes even if the entered password is blank.
Can somebody show me the correct way of achieving this?
I did some quick testing with this and it seems to work. The source code for the control has
Implying that you can overwrite the method.
So, create a class that inherits from the control
In your code behind:
Xaml to trigger the password prompt