Skip to content

PasswordBox - Bindable? #4043

Answered by makingbloke
msavazzi asked this question in Q&A
Feb 7, 2021 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

Yes it does have. Here's an example from a project of mine:

<PasswordBox mahControls:PasswordBoxHelper.CapsLockWarningToolTip="Caps Lock is on" mahControls:TextBoxHelper.Watermark="Password" mahShared:PasswordBoxBindingBehavior.Password="{Binding Password, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True, Mode=TwoWay}" />
Notice the MahApps PasswordBoxBindingBehaviour is used to bind the password to a Password string property in my ViewModel.

Just FYI the XAML namespaces are:

xmlns:mahControls="http://metro.mahapps.com/winfx/xaml/controls" xmlns:mahShared="http://metro.mahapps.com/winfx/xaml/shared"

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@msavazzi
Comment options

@timunie
Comment options

Answer selected by msavazzi
Comment options

You must be logged in to vote
2 replies
@msavazzi
Comment options

@timunie
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants