nikobarli
Topic Author
Posts: 180
Joined: 26 Apr 2017, 06:23

Input data validation

27 Jun 2017, 06:03

It seems that NoesisGUI doesn't currently provide a standard way to validate input data. Is there any plan to support it in the future ?

# In WPF, the standard methods include the use of INotifyDataErrorInfo and IDataErrorInfo (ref: https://stackoverflow.com/questions/195 ... on-c-sharp).

Do you have any sample to achieve similar behavior with the current NoesisGUI ?
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Input data validation

29 Jun 2017, 23:03

Yes, we have plans to incorporate data validation to bindings.

We don't have an example showing this kind of error validation. Right now it can only be achieved by exposing new properties in the ViewModel that can be used in the TextBox template to show the errors.
 
Sybaris
Posts: 39
Joined: 21 Feb 2019, 10:13

Re: Input data validation

13 May 2021, 23:52

Any news on this?
Is any of the WPF mechanisms implemented in the meanwhile?
ValidateOnExceptions for example is not working...

EDIT: To extend the question a bit: is there a way to react on an exception thrown in a binding? That's one of the ways WPF handles validations via ValidatesOnExceptions.
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Input data validation

17 May 2021, 10:21

Unfortunately there is no data validation implemented yet. Could you please create a ticket in our bugtracker asking for this feature?

As I said before the only alternative is extending viewmodel with properties that can be used in the data templates to show validation states.
 
Sybaris
Posts: 39
Joined: 21 Feb 2019, 10:13

Re: Input data validation

17 May 2021, 10:44

Thanks for your response!
Since we have panels with 30-40 text boxes that would clutter our view models just because of validation properties. Not sure yet how to work around this...
I'd still prefer to simply throw exceptions in the VM properties and handle them in the UI but since the exceptions are silently swallowed by Noesis, I can't find a way to react to them.
But I'll find a way and I'll probably post our approach here. ;-)
 
kristoffer
Posts: 8
Joined: 07 Oct 2021, 15:32

Re: Input data validation

30 Jan 2024, 12:43

+1 on this.
I guess this is the tracking issue regarding this subject.
https://www.noesisengine.com/bugs/view.php?id=1244

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 86 guests