I'd like to customize the look and feel of links on my diagram. Overall the default style isn't bad - at the moment I just want to customize the thickness and color of the links.
I've tried two ways of doing this. First, on my diagram object I have the following line of code:
diagram.LinkBrush = new SolidBrush(Color.FromRgb(255, 0, 0));
This didn't have any effect on the color of the links. However, I did notice that the
LinkBrush property is now obsolete, so I tried the suggested way of using a theme. This is my code for that:
MindFusion.Diagramming.Theme diagram_theme = new MindFusion.Diagramming.Theme();
MindFusion.Diagramming.DiagramLinkStyle diagram_link_style = new MindFusion.Diagramming.DiagramLinkStyle();
diagram_link_style.Stroke = new SolidBrush(Color.FromRgb(255, 0, 0));
diagram_link_style.StrokeThickness = 1;
diagram_theme.RegisterStyle(typeof(MindFusion.Diagramming.DiagramLink), diagram_link_style);
diagram.Theme = diagram_theme;
This also didn't seem to have any effect on the links in my diagram. Currently the default color of the links is a dark green color (as seen in the attached image).
For now this is all I am trying to accomplish, however, in the future I'd actually like to have custom link styles based upon the nodes that the link is connected to. I assume that in order to do this, I'll likely need to set the CustomDraw property of the diagram? Or handle the DrawLink event?