dotnet / dotnet/aspnetcore

Please can you provide a generic property store that functions similar to the existing ValidationMessageStore

Open
#66,504 1 comment 0 reactions 0 assignees View on GitHub
area-blazor Author: Migration Bot :robot: feature-request
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Please-can-you-provide-a-generic-propert/11024174)._

---
With Blazor development, I often have to create multiple fields to manage the state of a control. e.g. Enabled / Read only / Hidden etc. I have a FieldState class which includes the common state properties, so I end up with something like:

```
string customerName {get; set;}
FieldState cutomerNameState {get; set;}
```

i.e. Each field on the screen requires an additional field with its state, which I then bind to the control.

Each Customer is usually a class with many properties, which makes the above messy. e.g.

```
Customer customer {get; set;} // Contains CustomerId / Name / address etc.
FieldState customerId {get; set;}
FieldState customerName {get; set;}
etc..
```

The existing ValidationMessageStore (Microsoft.AspNetCore.Components.Forms) allows you to store / retrieve error details for a field using a FieldIdentifier or accessor.

It would be handy if you could provide similar functionality, but allow a generic type. e.g.
```
PropertyStore<FieldState> fieldStates {get; set;}
```

I could then have a single property which I can use to set / retrieve any field state using an accessor or FieldIdentifier.

---
### Original Comments

#### Feedback Bot on 1/7/2026, 00:34 AM:

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. You will hear from us in about a week on our next steps.

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.