How do I validate a user prompt that is displayed with a gray overlay

WPF Studio, Themes, and Shared Library for WPF Forum

The latest build of this product (v25.1.0) was released 1 month ago, which was before this thread was created.
Posted 8 hours ago by Pascal
Version: 25.1.0
Avatar

Hello,

I am currently building a form that is displayed through a user prompt with overlay. I am using the UserPromptBuilder pattern.

I would like to validate the content of the form, when the user clicks on OK. If validation fails, I'd like to show an error in red in the form. How do I do this?

Right now, I simply get the dialog's result and if there is an error, I show a message box with the error message. If I could display the error directly in my control, it would be great.

I tried using OnReponding but it didn't work.

Thanks,

Pascal

Comments (1)

Posted 8 hours ago by Pascal
Avatar

OK i found a work around. It's stupid but it works.

After I show the prompt, I get the result.

If it's ok, then I validate with a method on my form object. If validation pass, I continue. If it doesn't... it's a while loop and display the form a 2nd time. Since my validation method also changes the field to red, it makes what I want. So it works.

However, I was wondering if there was a more elegant way to make validations in a user prompt.

No need to work on a feature for this, my work-around works.

Thanks

Pascal

Add Comment

Please log in to a validated account to post comments.