uno icon indicating copy to clipboard operation
uno copied to clipboard

`TextBox` with mask or `MaskedTextBox`?

Open dmitrybv opened this issue 4 years ago • 8 comments

What would you like to be added:

Is it possible now to somehow use TextBox with mask or MaskedTextBox in the UnoPlatform? I need to enter date + time like this "99\99\9999 99:99".

Why is this needed:

For which Platform:

  • [ ] iOS
  • [ ] Android
  • [X] WebAssembly
  • [ ] WebAssembly renderers for Xamarin.Forms
  • [ ] macOS
  • [ ] Skia
    • [ ] WPF
    • [ ] GTK (Linux)
    • [ ] Tizen
  • [X] Windows

Anything else we need to know?

dmitrybv avatar Nov 24 '20 16:11 dmitrybv

I am trying maskedtextbox extensions from microsoft tollkit ported to uno but it is buggy in android and not working. On windows it work ok.

cesarchefinho avatar Oct 26 '21 00:10 cesarchefinho

Masking TextBoxes doesn't work (at least partially) due to the toolkit relying on Windows.Globalization.NumberFormatting to format Text, which is currently missing #6908. I assume changing this might enable CommunityToolkit masking to work as well. (At least I hope so, input masking is such a basic feature to have).

marwalsch avatar Mar 15 '22 15:03 marwalsch

@marwalsch Can you send the link to the code/control which is relying on Windows.Globalization.NumberFormatting in CommunityToolkit?

MohammadHadi2031 avatar Mar 16 '22 07:03 MohammadHadi2031

@MohammadHadi2031

Shame on me; it doesn't.

The NumberBox's properties linked to NumberFormatting are intrinsic to the class and not relying on any extensions from theCommunityToolkit whatsoever. Apologies for causing confusion!

marwalsch avatar Mar 16 '22 16:03 marwalsch

@MohammadHadi2031

Shame on me; it doesn't.

The NumberBox's properties linked to NumberFormatting are intrinsic to the class and not relying on any extensions from theCommunityToolkit whatsoever. Apologies for causing confusion!

No problem.

MohammadHadi2031 avatar Mar 16 '22 18:03 MohammadHadi2031

I am trying to port MaskedTextBox from Avalonia, but there are big diference in WPF to WinUI Events and i am lost.

Can someone see the code and help Here ? May be finish and pull request to Uno ?

Thanks a lot

MaskedTextBox.cs.txt

@CastelloBrancoTecnologia can you explain what you're blocked on?

Note that the community toolkit has TextBoxExtensions.Mask that does something quite similar, though I don't know if it is working properly at this time (some platforms may be missing events due to platform restrictions).

jeromelaban avatar Nov 21 '23 13:11 jeromelaban

@CastelloBrancoTecnologia can you explain what you're blocked on?

Note that the community toolkit has TextBoxExtensions.Mask that does something quite similar, though I don't know if it is working properly at this time (some platforms may be missing events due to platform restrictions).

Thanks for mentioning that. At least it does not work on Maccatalyst. Works fine on windows. I really like the behavior and I wish it worked on mac as well as it worked on windows.

randomroxks avatar Feb 07 '24 20:02 randomroxks