Double click on Diagram objects displays objects types

5 posts, 0 answers
  1. Sylvain
    Sylvain avatar
    3 posts
    Member since:
    Nov 2015

    Posted 03 Nov 2015 Link to this post

    Hello Telerik

     

    A double click on any node, edge, or text content of my Diagram display the underlying object type (c.f. attached image)

    I succeeded to prevent this for the nodes, adding the following property to the Diagram in XAML:

    ShapeDoubleClicked="diagram_ShapeDoubleClicked"

    And in code-behind:

    private void diagram_ShapeDoubleClicked(object sender, Telerik.Windows.Controls.Diagrams.ShapeRoutedEventArgs e)
          {
             e.Handled = true;
          }

    However I would like to disable this behavior for anything on the Diagram.

    I did try the same idea with the MouseDoubleClick event, but it didn't change anything: edges and texts still displays object types...

    Is there a solution to this?

    Thanks for your help,

    Sylvain

  2. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 05 Nov 2015 Link to this post

    Hi Sylvain,

    Double click on a diagram item enters its edit mode. In an MVVM scenario in order to have a meaningful content in edit mode you will need to define a ShapeEditTemplate and ConnectionEditTemplate. If such template is not defined the edit mode will display the result returned by the ToString() method of the shape/connection's view model.

    To disable the editing feature of RadDiagram you can set its IsEditable property to False.
    <telerik:RadDiagram IsEditable="False">

    Regards,
    Martin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sylvain
    Sylvain avatar
    3 posts
    Member since:
    Nov 2015

    Posted 06 Nov 2015 in reply to Martin Link to this post

    That was so simple!

    I haven't read anywhere in the RadDiagram documentation about the edit mode activated via double click; did I misread?

    Anyhow, thank you Martin!

  5. Martin
    Admin
    Martin avatar
    1101 posts

    Posted 06 Nov 2015 Link to this post

    Hello Sylvain,

    The diagram's edit mode is described in the Items Editing help article.

    Regards,
    Martin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Sylvain
    Sylvain avatar
    3 posts
    Member since:
    Nov 2015

    Posted 06 Nov 2015 in reply to Martin Link to this post

    Indeed, on the page's very first line.

    Thanks for pointing it out!

    Cheers,

    Sylvain

Back to Top
UI for WPF is Visual Studio 2017 Ready