WPF PasswordBox - PasswordRevealMode was not found in type 'PasswordBox' RRS feed

  • Question

  • The title says it all really.

    I've trying to make a log in window that uses a PasswordBox to mask the password; but I want the user to be able to peek at it if they suspect that they might have made a mistake.

    I've read the Microsoft documentation and it says to use the PasswordRevealMode property. However, whenever I try it, either in the xaml or the code behind I get the following error:

    PasswordRevealMode was not found in type 'PasswordBox'

    Is this a bug with VS Community 2019? Or do I need to do something else to get it to work?

    Friday, September 18, 2020 5:15 PM

All replies

  • Hi

    You might do better to post in the 'new home' for WPF.


    Regards Les, Livingston, Scotland

    Friday, September 18, 2020 5:31 PM
  • Hello,

    PasswordRevealMode is a property for Microsoft.UI.Xaml Nuget package for UWP projects (see image below). What you want is generally resolved by working with a TextBox and PasswordTextBox and events to flip flop between the two for hide/show.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Friday, September 18, 2020 6:13 PM