Custom snapping & rotation stepping

3 posts, 1 answers
  1. Jaroslav
    Jaroslav avatar
    1 posts
    Member since:
    Feb 2012

    Posted 09 Oct 2012 Link to this post

    Hi,

    In the diagraming component - is there a way how to do custom snapping? E.g. I have several components that can be joint together (say pipes) and if they are close enough with their correct edges they will snap. Something like the existing functionality IsSnapToItemsEnabled but not to edges but to custom points on an item...

    Also - I would like to enable rotation only by steps of 90 degrees... Is there an easy way to achieve this?

    Thanks,
    Jarda
  2. Answer
    Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 10 Oct 2012 Link to this post

    Hello,

    Currently we do not provide such an extensibility mechanism for the snapping but we have planned it for 2013 Q1 release. The only option is to implement the desired snapping from scratch.
    Regarding the rotation - it is also not supported to have rotation in steps of 90 degrees. I'm going to log a feature request for it, but can not give you a time schedule for its implementation.

    Greetings,
    Hristo
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 14 Feb 2013 Link to this post

    Hello Jaroslav,

    I have prepared a sample project demonstrating the snapping extensibility in RadDiagram that will be release with the upcoming 2013 Q1 official release.
    First the snapping service is retrieved (you could retrieve other services the same way too).
    Then the custom snapping logic is injected through the ISnappingService SetSnappingEngine method.
    Finally the custom snapping is implemented in class derived from SnappingEngine (overriding the GetVertical/horizontalMatchingOverride methods). GetVerticalMatchingOverride method, for example, takes two parameters - the item to snap, and the static (not moved) item that is used as the basis for the snapping. In case of multy-itemsnapping these two overrides are called for every item pair.

    Finally, I would like to mention again that this will be coming with the Q1 2013 release. I have included the binaries however, so you could play with it.
    We have not documented this feature yet, hope the help is coming soon.

    Hope this is what you are looking for. Please do not hesitate to contact us if you need more info or have any feedback.

    Greetings,
    Hristo
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top