How to bind to a PasswordBox in MVVM

前端 未结 30 2308
执念已碎
执念已碎 2020-11-22 11:50

I have come across a problem with binding to a PasswordBox. It seems it\'s a security risk but I am using the MVVM pattern so I wish to bypass this. I found som

30条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 12:33

    For anyone who is aware of the risks this implementation imposes, to have the password sync to your ViewModel simply add Mode=OneWayToSource.

    XAML

    
    

提交回复
热议问题