Revisit native control swapping for Entry on WinUI
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
The Windows platforms do not natively support a text entry control with an "IsPassword" mode; rather, they use a separate PasswordBox. Long ago, in the days prior to Forms 2.0, the Windows implementation would simply swap out the underlying controls at runtime if the IsPassword property changed. At the time (and using the renderer architecture) this was causing a lot of problems and bugs, so FormsTextBox (now MauiTextBox) was born; a custom TextBox control with a password mode to support obfuscation.
It solved several problems, but it's complicated and causes some new problems of its own. Since MAUI is using a different architecture (which already has better control swapping capabilities) and we are no longer supporting Silverlight/WinRT versions of the controls (as we were in Forms 2.0), it may make sense to drop the custom native control and return to swapping between TextBox and PasswordBox at runtime.
We should spike up a swapping implementation and evaluate whether it's better or worse than maintaining the MauiTextBox control.
Contributor guide
Research direction
Start by locating the WinUI Entry implementation and the MauiTextBox control, then trace how IsPassword changes are handled. Prototype runtime swapping between TextBox and PasswordBox and compare it with the existing control; done means documenting whether the approach is better or worse and identifying any regressions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100