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

control usage validators can produce warning + validate attached properties #1751

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

exyi
Copy link
Member

@exyi exyi commented Dec 10, 2023

It's not possible to add compilation warnings using control usage validators. It is also possible to validate attached properties on foreign controls.

        [ControlUsageValidator(IncludeAttachedProperties = true)]
        public static IEnumerable<ControlUsageError> ValidateUsage(ResolvedControl control)
        {
               if (control.TryGetProperty(MyAttachedProperty, out var prop))
                    yield return new ControlUsageError("Test warning", DiagnosticSeverity.Warning, prop.DothtmlNode);
        }

Used to implemented check that Validation.Target is not a primitive type (see #1583)

…erties

Used to implemented check that Validation.Target is not a primitive type (see #1583)
@exyi exyi added this to the Version 4.3 milestone Dec 10, 2023
@exyi exyi marked this pull request as ready for review December 12, 2023 11:45
@tomasherceg tomasherceg merged commit 91fc988 into main Jan 12, 2024
12 of 15 checks passed
@tomasherceg tomasherceg deleted the validation-target-warning branch January 12, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants