Skip to content

Add a string parameterName to the OnParametersSet[Async] method in Blazor #62135

Closed
@j4587698

Description

@j4587698

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Currently, the OnParametersSet method in Blazor does not provide any direct information about which specific parameter was set or changed. This can be limiting in scenarios where components need to perform specific actions based on the parameter that was updated.

Describe the solution you'd like

Proposal:
We should extend the OnParametersSet method to include an additional string parameterName argument. This argument would contain the nameof the parameter that was set, allowing components to easily determine which parameter triggered the update.

Example Usage:

protected override void OnParametersSet(string parameterName)
{
    if (parameterName == nameof(MyProperty))
    {
        // Perform specific logic when MyProperty changes
    }
}

### Additional context

_No response_

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