I tried to define a custom connector class by inheriting ConnectorViewModel, but it did not work. I need to insert in my SfDiagram a custom connector whose color, thickness, and style are different from the ones of the default connector after clicking on a menu’s button. This connector also requires to be lineal and to include a few extra properties. I will be very grateful if you could help me with an example that clarify how to add that functionality.
Thank you,
Tomas
I tried your approach, but it did not work. For reasons that I do not understand, it does not recognize the style from the axml code. So, I would like to know how to set the color, thickness, and the rest of the properties using C#. Additionally, I would like to know if the connector type (e.g. line and orthogonal) can be set within the object. I need to be able to insert several types of custom connectors into my diagram, each one with its style, and possibly, its type.
Thank you for all your help,
Tomas.
Thank you for your help. The provided example is close to what I want to reach, but the "key piece of this puzzle" is still missed. Though I can use a custom connector, I cannot use the drawing tool to link the nodes. I want to conserve the default behavior while replacing the default connector with one of the user-defined ones. I add below the blueprint of the event I am trying to define:
private
void Button_Click(object sender, EventArgs e)
{
- CODE to make
available the custom connector to link two nodes, without select them
-
Diagram.Tool
= Tool.DrawOnce; //it could be there or not. Though a way for returning to the default connector is important
Diagram.DrawingTool = DrawingTool.Connector
}
Please, if it is possible, could you include an example. It is easier to follow your explanation when it is available. I am sure others, as well as myself, will be very grateful for it.
Thank you,
Tomas