Anchor points are always rendered with constant size at this time. If you use the ShowAnchors.Always option, you could set it to Never instead to hide the standard marks, and draw marks as part of nodes.
E.g. if that's a ShapeNode, add a decoration element to your custom shape definition at the position where you want to see anchor points. Then the decoration element will resize automatically when the node is resized. If that's a TemplatedNode, add an Ellipse to your Xaml template with appropriate sizing constraints.
Alternatively, you could pass MarkStyle.Custom to AnchorPoint constructor and draw the anchor point from DrawAnchorPoint event handler. You will also need to redraw anchor points when nodes are resized:
private void OnDrawAnchorPoint(object sender, DrawAnchorPointEventArgs e)
{
var point = e.AnchorPoint;
var adorner = (AdornerVisual)VisualTreeHelper.GetParent(point);
var node = (DiagramNode)Diagram.GetDiagramItem(adorner);
var nodeSize = node.Bounds.Size;
var radius = Math.Min(nodeSize.Width, nodeSize.Height);
radius /= 8;
var cx = point.RenderSize.Width / 2;
var cy = point.RenderSize.Height / 2;
e.Graphics.DrawEllipse(Brushes.White, new Pen(Brushes.Black, 1),
new Point(cx, cy), radius, radius);
}
void RedrawAnchorPoints(DiagramNode node)
{
var adorner = node.Adorner;
var count = VisualTreeHelper.GetChildrenCount(adorner);
for (int i = 0; i < count; i++)
{
var point = VisualTreeHelper.GetChild(adorner, i) as AnchorPoint;
if (point != null)
point.InvalidateVisual();
}
}
private void OnNodeModified(object sender, NodeEventArgs e)
{
RedrawAnchorPoints(e.Node);
}
I hope that helps,
Stoyan