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

using Shift key to draw Orthogonal Connector?

3 Answers 52 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
동섭
Top achievements
Rank 1
동섭 asked on 19 May 2017, 09:46 AM

Hey, Guys.

While using Raddiagram, I wonder how can if user draws his connector with shift key pressed, then drawed connector would be orthogonal. Without setting RouteConnection property true.

(while ActiveTool = MouseTool.ConnectorTool)

 

Is any approaching to get this feature?

 

Thanks. 

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 23 May 2017, 10:09 AM
Hello,

In Diagram every connection can be separately routed or not - you can use their Route property. On the other hand you can add your own logic in default ConnectionTool like so:

InitializeComponent();
           ToolService toolService = this.diagram.ServiceLocator.GetService<IToolService>() as ToolService;
           toolService.ToolList[5] = new CustomConnectionTool();

public class CustomConnectionTool : ConnectionTool
  {
      public override bool MouseDown(PointerArgs e)
      {
          bool result = base.MouseDown(e);
 
          if (KeyboardModifiers.IsShiftDown)
          {
              this.ActiveConnection.Route = true;
          }
          return result;
      }
  }

Please also find the following resources for tools and services customizations:

Tools Customization
Custom Conenctor Tools SDK
Custom Tools SDK




Regards,
Petar Mladenov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
동섭
Top achievements
Rank 1
answered on 24 May 2017, 05:33 AM

Thanks for your reply Petar.

But feature what I need is Like Powerpoint Line Feature.

When user moves his mouse with shift key down, the straight line only drawed in 8 way (0, 45, 90, 135, 180, 225, 270, 335 degrees).

0
Petar Mladenov
Telerik team
answered on 26 May 2017, 05:51 AM
Hi 동섭,

Can you send us a captured video of the behavior you describe ? We are not sure how you accomplish the 45, 90, 135 degrees rotation. However, keep in mind that since this is not a default diagram behavior, we can primarily advice on the tools, methods you can use in our framework to achieve such customization.

Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
동섭
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
동섭
Top achievements
Rank 1
Share this question
or