Hİ,
I am using a custom connection for a special purpose and want to use MVVM. But I do not know how to create custom connection instance when using MVVM. Because it needs to be created and added to the diagram instance not the graphsource. Graphsource have AddLink method but it do not take RadDiagramConnection. Can you help me to find a way to use that Custom Connection class?
Thank you,
Sarper
I am using a custom connection for a special purpose and want to use MVVM. But I do not know how to create custom connection instance when using MVVM. Because it needs to be created and added to the diagram instance not the graphsource. Graphsource have AddLink method but it do not take RadDiagramConnection. Can you help me to find a way to use that Custom Connection class?
Thank you,
Sarper
4 Answers, 1 is accepted
0
Accepted
Hi Sarper,
Let us know if this works for you.
Regards,
Miro Miroslavov
the Telerik team
You should inherit the RadDiagram and override the GetConnectionContainerForItemOverride(object item) method. This method creates the actual visual connection (usually RadDiagramConnection) for every ILink object in your ViewModel, so if you override it and change the code to the following, it should work:
protected overrideIConnection GetConnectionContainerForItemOverride(object item)
{
return new MyCustomConnection();
}
Regards,
Miro Miroslavov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
0
Sarper
Top achievements
Rank 2
answered on 16 Oct 2012, 06:30 PM
Hi Miro Miroslavov,
I create custom diagram class and add that override method and.. It worked like a charm... I appreciated for your help really.
I think that RadDiagram Framework is really good and flexible for all purposes. It has many features to customize and configure..
Thank you.
All the best,
Sarper
I create custom diagram class and add that override method and.. It worked like a charm... I appreciated for your help really.
I think that RadDiagram Framework is really good and flexible for all purposes. It has many features to customize and configure..
Thank you.
All the best,
Sarper
0
Sammy
Top achievements
Rank 1
answered on 24 Jul 2014, 04:53 AM
Hello,
I have a further problem. If I drag a connection from a connector of a shape to a connector of another shape this override method also executed but the graphsource is not updated and the datacontext of the connection is not my custom modelview class. How can I make the diagram to update its graphsource with my custom modelview classes?
Thanks,
I have a further problem. If I drag a connection from a connector of a shape to a connector of another shape this override method also executed but the graphsource is not updated and the datacontext of the connection is not my custom modelview class. How can I make the diagram to update its graphsource with my custom modelview classes?
Thanks,
0
Hello,
Could you please take a look at the attached project? It demonstrates how the RadDiagram should be used when you need to create derived connections and shapes in MVVM scenario.
Do not hesitate to ask if you need any further assistance.
Regards,
Pavel R. Pavlov
Telerik
Could you please take a look at the attached project? It demonstrates how the RadDiagram should be used when you need to create derived connections and shapes in MVVM scenario.
Do not hesitate to ask if you need any further assistance.
Regards,
Pavel R. Pavlov
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.