Hello Devz,

Because security matters, you will need at one point to use a PasswordBox in your WPF application.

But Microsoft didn’t make this control bindable for security reasons (in memory access).

So if you’re using MVVM it will be a bit tricky. Different solutions exist, but really not convenient or will not respect the MVVM principles.

Samuel Jack posted on his blog a simple solution to make it bindable.

Create a PasswordBoxHelper class:

Then reference it in your View:

And then use it in your control:

As simple as that…

Happy coding! 🙂