Blazor-Diagrams / Blazor.Diagrams

A fully customizable and extensible all-purpose diagrams library for Blazor
https://blazor-diagrams.zhaytam.com
MIT License
921 stars 177 forks source link

Is it possible to embed interactive components in LinkWidets? #179

Closed jimitndiaye closed 2 years ago

jimitndiaye commented 2 years ago

Basically I'd like to achieve something similar to how you are positioning LinkLabels except replacing the Label text with a custom icon button. i notice that that link label is using MarkupString and therefore static HTML and so I'm not sure if embedding a button instead works.

zHaytam commented 2 years ago

Hello,

The use of MarkupString in the labels was forced because Blazor didnt handle foreign objects well at the time. With .NET 6, I believe it was fixed.

I think you can achieve what you want by creating a new component for labels and registering to be rendered instead of the default one. Then you can use whatever you want inside the foreign object, including buttons.

Please tell me if this helps!

jimitndiaye commented 2 years ago

Thanks. I'll try that and let you know.

zHaytam commented 2 years ago

I'll close this since I believe it's answered. Please feel free to re-open if you think otherwise.