how to add custom or static shape in diagram with "IGraphSource" binding

1 Answer 5 Views
Diagram
Parth
Top achievements
Rank 1
Iron
Iron
Parth asked on 19 Apr 2024, 09:49 AM | edited on 19 Apr 2024, 09:50 AM

I'm trying to create a "custom shape" in diagram control, but custom node disappears when i add it to IGraphsource in diagram control.

I am also attaching the sample project so if i am doing anything wrong can you please check.

I added the .png file for the custom shape I wanted

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 22 Apr 2024, 10:36 AM

Hello Parth,

The RadDiagram control does not support adding elements to its Items collection when its GraphSource property is set.

In this case, since the MVVM approach is followed, to add container shapes, new ContainerNodeViewModelBase<object> instances (or classes deriving from it) should be added to your graph source.

More information on this view model can be found at the following link:

WPF Diagram - ContainerNodeViewModelBase - Telerik UI for WPF

An example that contains such a setup is the MVVM one from our SDK Samples Browser. Additionally, its implementation can be checked in our GitHub repository:

xaml-sdk/Diagram/MVVM at master · telerik/xaml-sdk · GitHub

I hope the provided information will be of help to you.

Regards,
Stenly
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com
Tags
Diagram
Asked by
Parth
Top achievements
Rank 1
Iron
Iron
Answers by
Stenly
Telerik team
Share this question
or