0

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.

Lucy
  • 13
  • 7
  • You want to bind to Password property of Password box? – wingerse Apr 21 '16 at 08:29
  • I just want passwordbox to update the value of itself actively, When I write something in the passwordbox the information doesnt ''change'' to the one I am writing currently until i leave the passwordbox. I want to be able to write something then the passwordbox value is the value I just wrote without leaving the passwordbox. – Lucy Apr 21 '16 at 08:35
  • PasswordBox's Password property is not a dependency property. How are you even binding to it in the first place? Or are you using Procedural code to get the Password and setting it? – wingerse Apr 21 '16 at 08:39
  • Here there is good question about using `PasswordBox` http://stackoverflow.com/questions/1483892/how-to-bind-to-a-passwordbox-in-mvvm?rq=1 – bars222 Apr 21 '16 at 08:42
  • I use the whole passwordbox as a object. Via a button using a CommandParameter using the passwordbox's x:name (ElementName). – Lucy Apr 21 '16 at 08:44
  • And no I am not saving the password in a property. – Lucy Apr 21 '16 at 09:09

1 Answers1

0

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.

elixenide
  • 44,308
  • 16
  • 74
  • 100
Lucy
  • 13
  • 7