TextTool Exception When Diagram Bound To Collection

3 posts, 1 answers
  1. Michael
    Michael avatar
    26 posts
    Member since:
    Oct 2014

    Posted 28 Oct 2014 Link to this post

    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. Answer
    Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 29 Oct 2014 Link to this post

    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.

     
  3. DevCraft banner
  4. Michael
    Michael avatar
    26 posts
    Member since:
    Oct 2014

    Posted 23 Dec 2014 Link to this post

    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
Back to Top