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

Load/Deserialize with GraphSource?

2 Answers 87 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 07 Jan 2014, 09:53 PM
I would like to be able to Load (and Save) a diagram by initiating the operation in the ViewModel.

Currently, I need to inherit from RadDiagram and override the OnOpenCommandExecuted method to have custom Load behaviour. This is fine, except that I would like to Clear the diagram before Loading the saved XML. I can't use the RadDiagram.Clear() method when using GraphSource, however.

Short of implementing my own Serialize/Deserialize in ViewModels, is there a nice way to achieve this currently?

Thanks

2 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 10 Jan 2014, 12:14 PM
Hello Terry,

When a graph source is used, you can clear the InternalItems and InternaLinks collections before loading the XML file. This logic can be triggered by a custom command implemented in your ViewModel. Furthermore, you will be able to trigger that command from code behind just before loading the new XML.

Regarding the requirement for custom serialization, you need to have in mind that the RadDiagram uses SerializationService to manage those features. You can create your custom service and use it instead of the default ones. For more information please refer to our documentation.

I hope this information is helpful.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Terry
Top achievements
Rank 1
answered on 17 Jan 2014, 05:27 PM
Thank you. I ended up using InternalItems to handle this functionality
Tags
Diagram
Asked by
Terry
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Terry
Top achievements
Rank 1
Share this question
or