I am developing a windows phone application.In that i ask the user to login.
On the login page the user has to enter password.
Now what I want is that i give user a check box which when selected should show the characters of the password.
I have not seen any property on password box to show password characters.
Please suggest some way to do it.
with default passwordbox it's not possible to implement the feature you want.
more information you can find here: http://social.msdn.microsoft.com/Forums/en/wpf/thread/98d0d4d4-1463-481f-b8b1-711119a6ba99
You could create your own control that inherits from textbox however after each character you replace it with an *, storing the true value within a private variable on the page. Using a checkbox you can then toggle whether the value in the textbox shows the true value or the * value.
It's not an elegant solution nor is it a best practice, however I think it's still an alternative if you are willing to live with it.
Don't think that is possible with PasswordBox... just a thought, but you might accomplish the same result using a hidden TextBox and when the user clicks the CheckBox, you just hide the PasswordBox and show the TextBox; if he clicks again, you switch their Visibility state again, and so on...
Edit
And here it is how!
Just add a page, change the ContentPanel to a StackPanel and add this XAML code:
Next, on the page code, add the following:
This works fine, but with a few more work, you can do this fully MVVM'ed!