Category / Section
How to decide whether to drag or draw a connection on port at runtime in the WPF Diagram (SfDiagram)?
1 min read
By default, click and drag action on port will draw a new connection. This default behavior can be modified at runtime by using the SetTool() method of WPF Diagram (SfDiagram).
C#
public class CustomDiagram : SfDiagram
{
protected override void SetTool(SetToolArgs args)
{
if (args.Source is IPort)
{
args.Action = ActiveTool.Drag;
}
else
{
base.SetTool(args);
}
}
}
Did not find the solution
Contact Support