[Validation series] <dot:Validator enhancement proposal

Hi,

A proposal this time :smiley:

Since we will have lots of validators everywhere, and Ctrl+K+D (in Visual Studio 2022) auto-format of markup changes this:


into this:
image

it would be exceptionally useful to have a control property on the validator where we can set the text as to avoid it becoming 3 lines instead of one line…

do see first response from Custom code control not recognized in markup

UPDATE

I’ve derived <dot:Validator into a custom code control, <ccc:NGMValidator and it works, as intended, as a one-liner:

But,
:question:
Why does my custom code control property called ErrorMessage appear as suggestion in other controls, even on simple html elements ?

I don’t want this to happen, please advise.
Here is my NGMValidator code:

Because it has the [AttachedProperty] attribute.

Other Validator properties can be used on other controls essentially turning any control into a validator, I suppose you copypasted it from there.

1 Like

Yes! This was it.
Your guess was right, I copy pasted from a Validator property’s code.