wpf

PasswordBox loses its content on navigation


I'm using a PasswordBox on a Page. Because of the implemented workflow the user can navigate to sub pages (NavigationWindow) and than return with GoBack() to the main page.

But when doing that, the password box is always empty! My job is to prevent that behaviour, but at the moment I have no clue how do achive that.

It would be great if you could help me out. Thanks


Solution

  • It is a feature.

    See: How to bind to a PasswordBox in MVVM

    To enable the backward navigation the state of the page needs to be stored. And that is not secure.