dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.35k stars 9.99k forks source link

Feature request: Blazor attached properties #22316

Open njannink opened 4 years ago

njannink commented 4 years ago

It would be great if Blazor would support something similar that Wpf has for attached properties to be able to modify existing html or razor components.

Eg

<button RichTextEdit.Action="Bold" RichTextEdit.Key="Ctrl+B">B</button>

The RichTextEdit.Action extended property in this case would write an additional value to the class list of the html button and the RichTextEdit.Key would build some keyboard event handler.

The extension properties should be able to use the `[CascadingParameter]' logic to access the RichTextEdit in this case.

Now when you want to extend existing components you need to use inheritance and or composition what causes a lot of 'unneeded' classes and in case of composition a lot of boilerplate code to forward the logic.

mkArtakMSFT commented 4 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.

njannink commented 4 years ago

That is fine, I wouldn't expect it to be implemented pronto, But as I stated I think it would be a great addition to Blazor like in Wpf.

ghost commented 10 months ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.