Blazor-Diagrams / Blazor.Diagrams

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

create new node from button in other node #338

Closed jm942 closed 10 months ago

jm942 commented 10 months ago

After a long time a try to pickup again. Currently i started from the latest version 3.0.0 ain the dev branch available.

I created a custom node widget which has button in it. From this button i want to create a new related node.

What is the best way to achieve this ? I see some events existing when a node is already added or changed but no event for add a node and it seems i cannot call diagram.nodes.add from the widget directly.

Any suggestions ?

zHaytam commented 10 months ago

Why can't you call Diagram.Nodes.Add from the widget?
The diagram instance is a cascading value, you should still be able to get it in your widgets.

jm942 commented 10 months ago

Thanks. Solved. I forgot to put the cascading parameter value on the widget level.