Search code examples
c#wpfmvvmbindingpasswordbox

WPF Passwordbox with Update Source Trigger


Currently I'm doing a registration to create a new user to login, but to create an user I would like to have updatesourcetrigger on my fields just like I do for the name field for an example:

<TextBox Text="{Binding FirstName, UpdateSourceTrigger=PropertyChanged}"></TextBox>

The functions to create the user works but the updating information at the current time doesn't work really unless you press on another textbox for an example, if you do that then the information on the passwordbox will update to the new value. I am using MVVM so I don't want any code behind in the xaml.cs file. I want it to be updating its value like on the xaml code I mentioned.


Solution

  • Solved it by myself without any bindings or a updatesourcetrigger.

    I did it with a commandparameter. With a button using a commandparameter, which means that it gets current information on the passwordboxes.