Hi
Tealer,
Requirement:
Need to make the port position in the node static while resizing the node too.
We have prepared a simple sample to achieve your requirement. In the sample, we
have used PropertyChanged to achieve your requirement. Please find the code
example and sample below.
Code
example:
|
var newHeight = node.UnitHeight +
heightDifference;
var nodeBounds = (node.Info as INodeInfo).Bounds;
if (node.Ports is PortCollection ports &&
ports.Count > 0)
{
var dockportCollection =
ports.Where(e => e is IDockPort).ToList();
foreach (IDockPort dockport in dockportCollection)
{
var sourcePointY = nodeBounds.Height
* dockport.SourcePoint.Y;
var targetPointY = nodeBounds.Height
* dockport.TargetPoint.Y;
dockport.SourcePoint = new Point(dockport.SourcePoint.X, sourcePointY / newHeight);
dockport.TargetPoint = new Point(dockport.TargetPoint.X, targetPointY / newHeight);
}
}
|
Sample
link: https://www.syncfusion.com/downloads/support/forum/175898/ze/Swimlane-2114992106
Regards,
Karkuvel
Rajan S