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

How can we capture the Event for Add connection and Remove Connetion on a Port , or in any case #344

Closed ATEEKGIT closed 10 months ago

ATEEKGIT commented 10 months ago

Trying to figure out how to get Add connection and Remove connection event on a port , as when user drag a link and connect to a port that time needs to execute my code.

its version 3.0

Even if there is any place where we can capture this link/unlink event either global level that will be fine.

Appreciate your support.

zHaytam commented 10 months ago

You have the general Diagram.Links.Added event, which should be your first step.
This event is triggered when a link is added, either manually or when the user starts dragging from a port.

To check if the link is new and its from a port, simply do newLink.Source is SinglePortAnchor && !newLink.Attached.

If you want to know when that link got attached, you have to use the link events Attached and TargetChanged

ATEEKGIT commented 10 months ago

it worked perfectly the way i needed , sorry for disturbance , in absense of documentation i could not figure it out myself , you are love :) thanks aloooooot