This is a migrated thread and some comments may be shown as answers.

Customizing and setting connectors of a Node

1 Answer 139 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jeremi
Top achievements
Rank 1
Jeremi asked on 15 Nov 2017, 09:05 AM

I am using a ObservableGraphSourceBase with a fairly standard Link model and a  HierarchicalNodeViewModel as bases for my Diagram to display.

Within my Diagram declaration in the XAML I am successfully using ShapeStyleSelector property to set the style of my Nodes as they are dropped or read into the diagram.

I am looking for a way to remove and or add Connectors to the Nodes either from the Style via a Setter of some sort or somehow grammatically with a MVVM friendly method.

 

I have tried from within the HierarchicalNodeView model but it does not have access to the resulting shape it seems. Also the ObservableGraphSourceBase does not seem to have access to the resulting RadDiagramShape which houses the Connectors list.

 

Please help.

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 16 Nov 2017, 10:00 AM
Hello Jeremi,

We are in a process of adding article in our documentation regarding custom connectors and MVVM RadDiagram. It will be live before R1 2018 in January.
Till then, you can take a look at the following forum threads where some projects are also listed:

Custom Connectors and MVVM

Adding Custom Connectors in XAML style

You can also vote for the following feature request:

Diagram: Built-in support for MVVM connectors
In addition to the projects, you can add string properties named, for example SourceConnectorPos, TargetConnectorPos in the Link model class. They can have default values of "Auto" and be bound to the SourceConnectorPosition and TargetConnectorPosition properties of the RadDiagramConnection via Style which applies to the connections. This way you have the ability to specify to which custom connector every connection attaches in the moment of creating the graph source. 

Please let us know if you need any further assistance.


Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
Jeremi
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or