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

TextTool Exception When Diagram Bound To Collection

2 Answers 47 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 28 Oct 2014, 02:05 PM

I am using the diagram tool and it is bound to a collection of shapes which represent business objects.  The collecion derives from GraphSourceBase<LocationNodeViewModel, LinkViewModelBase<T>> and a DataTemplateSelector is used to set the shape.  All business shapes are not editable, nor are the connections between them.  I also need to add blocks of text anywhere in the diagram as text annotations.  But, when I set the ActiveTool to TextTool, an exception is thrown.  It appears that the textblock cannot be added to the bound collection.  If I unbind the diagram from the collection, the text will be added just fine.

Do I need to customize the shape that represents the text block being added?  And does this require customizing the TextTool itself, or is there some other preferred approach to achieving this?  I have recreated this issue in a sample project if needed.

Much thanks in advance,

Mike

2 Answers, 1 is accepted

Sort by
0
Accepted
Peshito
Telerik team
answered on 29 Oct 2014, 08:04 AM
Hello,

I tried to reproduce your issue in a MVVM scenario but to no avail. Please find attached the sample project I worked on, where changing the ActiveTool to TextTool works fine. In order to be able to provide you with a possible solution, please update the project so the issue become reproducible or simply send us a runnable copy of yours. Keep in mind that as this is a forum thread, you will need to use a third party site for uploading files and share it with us.

Regards,
Peshito
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Michael
Top achievements
Rank 1
answered on 23 Dec 2014, 02:47 PM
As a follow up to this post, I ended up submitting a support ticked for this so I could upload a code example.  The issue was that I was binding a view-model to the diagram that inherited from GraphSourceBase<> and not ObservableGraphSourceBase<> as indicated in the documentation.  Once I made the change I could toggle the TextTool and add text shapes.

Mike
Tags
Diagram
Asked by
Michael
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Michael
Top achievements
Rank 1
Share this question
or