ui:PasswordBox Binding issues
See original GitHub issueDescribe the bug
Here are two bugs if I binding Text
as password(mvvm two-way)
- The password&text change double when
IsPasswordRevealed
is false - The
text
value is*
whenIsPasswordRevealed
is false, if I post thetext
to db the value saved in db is*
To Reproduce
Just binding a property
<ui:PasswordBox
Grid.Column="1"
MaxLength="64"
PasswordChar="*"
Text="{Binding ViewModel.Config.Passcode}" />
Expected behavior
Actually I just wanna find a property to bing two-way
Screenshots
Desktop:
- OS: [Windows11 21H2 22000.856]
- .NET: [net6.0]
- Version: [2.0.2]
Additional context
More info refer #373
Bugs may fire here
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How to bind to a PasswordBox in MVVM
I have come across a problem with binding to a PasswordBox . It seems it's a security risk but I am using the...
Read more >Binding to a PasswordBox (MVVM) - EASY WPF (.NET CORE)
Learn how to bind to a PasswordBox by creating a custom control. One of the most frustrating issues with the WPF PasswordBox is...
Read more >Security Risk in Binding WPF PasswordBox Password
First, don't ever bind passwords in WPF. There are other alternatives you can use, such as passing your entire PasswordBox control as a...
Read more >WPF - Passwordbox input not updating
I'm creating a small WPF app (Visual Studio 2022, WPF , .Net 6.0, XAML-C# 10 and SQL Server), but having some trouble with...
Read more >NET Native compiled build: binding issue with PasswordBox
When compiled with .NET Native, binding PasswordBox.Password will only pass an empty string. ... What is the expected behavior? ... What is the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t think WPFUI’s
PasswordBox
properly supports binding to the password at this point.Instead, I use use WPFUI’s control (but do use WPFUI’s styling).
First, a utility class (I didn’t write this; I think it originated at http://blog.functionalfun.net/2008/06/wpf-passwordbox-and-data-binding.html):
Then I can do:
Now you just have a regular
string
INPC property in your view model, e.g.@pomianowski
Sorry for the late response, after review and check, here is NEW issue about
PlaceholderText
as below gif.PlaceholderText
can not disappear whenIsPasswordRevealed
is truePlaceholderText
disappeared for ever when you clear the valueThanks