Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : TextBox error handling #158

Open
MatFillion opened this issue Jun 9, 2020 · 4 comments
Open

Feature : TextBox error handling #158

MatFillion opened this issue Jun 9, 2020 · 4 comments
Labels
blocked Needs attention or a feature added in Uno first

Comments

@MatFillion
Copy link
Contributor

To offer error state in textbox, can we use an attachedproperty and use something like
INotifyDataErrorInfo or something similar ?

@Xiaoy312
Copy link
Contributor

the spec for input validation is still under review on MS side: microsoft/microsoft-ui-xaml-specs#26
using INotifiyDataErrorInfo would probably means the control itself has to support, which we probably dont want to touch that, unless it is official
it would be also hard to obtain the binding source/path from the control layer
---
Here is something I have in mind:

string FirstName
IValidationResult FirstNameValidation
  - enum[warning|error]: Level
  - string Reason

FirstNAmeValidation could be updated on FirstName changed (sync), based on rx-subcription (async/magic), or on demand (manual)
we could either:

  1. duplicate every textbox styles and add a validation variant of it
  2. create a composite of textbox with the info bulb, error message

    we might have some issue to inject Foreground and BorderBrush or make them look good, if the base control template isnt using those property, or the visual state animation isnt animated off them

@MatFillion
Copy link
Contributor Author

MatFillion commented Jul 6, 2020

Specs are valid in WinUI 3.0 preview 1 so we should use that! It will need to be implemented in Uno first.

@MatFillion MatFillion added the blocked Needs attention or a feature added in Uno first label Jul 8, 2020
@MatFillion
Copy link
Contributor Author

MatFillion commented Jul 8, 2020

Here's the sample in the WinUI gallery https://github.com/microsoft/Xaml-Controls-Gallery/blob/winui3preview/XamlControlsGallery/ControlPages/InputValidationPage.xaml.cs

GitHub
This app demonstrates the controls available in WinUI and the Fluent Design System. - microsoft/Xaml-Controls-Gallery

@carldebilly
Copy link
Member

Related to unoplatform/uno#4839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Needs attention or a feature added in Uno first
Projects
None yet
Development

No branches or pull requests

3 participants