CommunityToolkit / CommunityToolkit/dotnet

Nested validation?

Open
#937 0 comments 5 reactions 0 assignees View on GitHub
feature request :mailbox_with_mail:
Dominant language
C#
Stars
3.8k
Forks
400
PR merge metrics
No merged PRs in 30d

Description

### Overview

The problem is explained quite clearly in #557. I believe there should be some kind of capability built into the toolkit to allow or facilitate one ObservableValidator to host another one, and when the parent "ValidateAllProperties()" is called, the call is passed through to the children. Whereas I can think of a few ways to implement this, I would bow to the wisdom of those closer to the project.

I haven't given tons of detail below, but I'd like to think it would be obvious. If not, I'll gladly provide more detailed information.

### API breakdown

I don't think there are necessarily any API changed required.

### Usage example

My preference would be that ValidateAllProperties() automatically (i.e. by default) also called the same method on child properties that implement "ObservableValidator".

### Breaking change?

No

### Alternatives

Whereas there is one possible work-around suggested in #557, it's not particularly elegant, and likely not the one I'd choose.

### Additional context

_No response_

### Help us help you

No, just wanted to propose this

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.