You can't change the UpdateSourceTrigger
of an existing binding in the way you're attempting because, as Clemens points out, it is not a dependency property. Normally, you'd be able to accomplish this by using a Style
with DataTrigger
s that replace the entire binding, but in this case you can't do that either because Password
is also not a dependency property.
This later point is an intentional design choice on Microsoft's part:
When you get the Password
property value, you expose the password as plain text in memory. To avoid this potential security risk, use the SecurePassword
property to get the password as a SecureString
.
For more of an explanation you can take a look at this great answer from the question How to bind to a PasswordBox in MVVM.