Changing link handles

Hi,

In my diagram, I allow the user to draw links between ports. When the user selects an existing link, the two ends get adorned with turquoise diamonds. When the user is dragging a link, the ports are adorned with magenta squares and the link itself turns blue.

How can I change the colors of these?

Thanks,
Bob

You can copy and adapt the templates that GoXam uses by default. These are shown in the Default…xaml file in the docs subdirectory of the installation.

You want to copy the DefaultRelinkFromAdornmentTemplate, DefaultRelinkToAdornmentTemplate, DefaultTemporaryNodeTemplate, and DefaultTemporaryLinkTemplate.

Hi Walter,

Thank you. It looks like those templates are in GenericWPF.xaml.

Once I copy and modify them, how do I integrate them into my XAML? Are there properties on the ports or links that I set to those templates?

Route.RelinkFromAdornmentTemplate, Route.RelinkToAdornmentTemplate, LinkingBaseTool.TemporaryNodeTemplate and LinkingBaseTool.TemporaryLinkTemplate.

Depending on your app, you may want to set the latter two properties on both the Diagram.LinkingTool and the Diagram.RelinkingTool.

Thanks, Walter. I got it working.

  • Bob