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

Bind connector creation by view model binding

1 Answer 117 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 24 Jun 2019, 08:38 AM

Hi,

I'm using ObservableGraphSourceBase and NodeViewModelBase with a StyleSelector to render the shapes. Nice. But I want my shapes to have connectors in certain positions dependent on the view model. How can I do this?

In my case the shapes are rectangular with the left connectors being inputs and the right connectors being outputs. For a type 'A' NodeViewModel I want the shape to have 2 input connectors (left), no top or bottom connectors, and one right connector.

I can add/remove connectors on a drag and drop or edit event ... but how do I create the shape, via a style, with the connectors defined by the NodeViewModel?

Thanks

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 26 Jun 2019, 12:13 PM
Hello Robert,

RadDiagram doesn't have a MVVM support for the shape's Connectors collection. However, you can implement this manually, by using an attached property. This approach is shown in the attached project. Can you give it a try and let me know if this helps?

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Diagram
Asked by
Robert
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or