Skip to content

[Blazor] PersistentState design question #63329

@AndreiGorlov

Description

@AndreiGorlov

@AndreiGorlov thanks for contacting us.

This is by design, CascadingParameters and other form of parameters (which PersistentComponentState is a form of) must be public properties.

Originally posted by @javiercn in #63268

Property marked with [CascadingParameter] does not have to be public. Attribute works fine with private/protected properties.

[PersistentState], on the other hand, applicable to public props only. What is the rationale behind this design?
I just want to persist component state. Why do I have to expose it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions