We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Pan to center when moving node from outside the bounds

Thread ID:

Created:

Updated:

Platform:

Replies:

110678 Aug 20,2013 04:04 PM UTC Aug 22,2013 10:51 AM UTC WPF 3
loading
Tags: Diagram
Mathieu Myrand Bolduc
Asked On August 20, 2013 04:04 PM UTC

Good day,

Is there a property to disable the "pan to center" operation that occurs when a node is moved outside the bounds?

Thank you for your time,

Mathieu

Sudhakar C [Syncfusion]
Replied On August 21, 2013 05:44 AM UTC

Hi Mathieu,

 

We are unable to understand your query. Can you please provide more information about your requirement. However, we can disable the Panning by disable the IsPanEnabled property of the diagram view. Please refer the below code snippet.

 

Code Snippet:

 

// Enable the Panning

diagramView.IsPanEnabled = true;

 

// Disable the Panning

diagramView.IsPanEnabled = false;

 

 

Please let us know if you have any concerns on this.

 

Regards,

 

Sudhakar C

 


Mathieu Myrand Bolduc
Replied On August 21, 2013 12:09 PM UTC

It is easier to see if you try it.

1 - Run the project
2 - Pick a node
3 - Drag the node outside the bounds
4 - Drop the node
5 - Pick the node and move it towards its original place.

When you move the node from outside the bounds, it re-centers automatically the view, a bit like panning.  This is the behavior I would like to stop and I was wondering if I had missed an option, or if I have to do it manually by stretching the bounds.

Thank you


Node_spring_to_center_db1d4412.rar

Sudhakar C [Syncfusion]
Replied On August 22, 2013 10:51 AM UTC

Hi Mathieu,

 

By default, the size of the diagram page is depending on the elements which are placed in the diagram page. So, when we move the element to outside of the diagram page’s bounds, the diagram page size will be changed based on that element.

 

For example,  Consider a single Node is placed in the position of 250,250 and the size of that node is 100,100. Now, the size of the diagram page will be (Position of the Node + size of the Node) 350,350. If we move that node to the position of (500,500), the size of the diagram page also changed to (600,600). And also, if we move that node to the position of (100,100), the size of the diagram page is also changed to (200,200). For more information please refer the attached video (Video Name : BehaviourVideo) . In that video, the coloured area is diagram page.

 

In your scenario. when move the Node from outside of the diagrampage’s bounds to inside, the size of the diagram page is changed. So that we can see the behaviour like panning. This is not an issue. This is a current behaviour.

 

However, if you want to stop this behaviour, we are suggested you to please use the BoundaryConstraintsArea property of DiagramView. BoundaryConstraintsArea is used to define the diagram page size. Please refer the code snippet.

 

Code Snippet :

 

 

// Enable the BoundaryConstraintsEnabled property

diagramView.BoundaryConstraintsEnabled = true;

 

//Set value the BoundaryConstraintsArea

diagramView.BoundaryConstraintsArea = new Rect(0, 0, 1000, 600);

 

// Disable the SizeToContent property

diagramView.SizeToContent = false;

 

 

For more information about the BoundaryConstraintsArea, please refer our Syncfusion online documentation using the below link.

 

Documentation Link : http://help.syncfusion.com/ug/wpf/diagram/default.htm#!Documents/46272definingdiagrampage.htm

 

Note :  We should  enable the BoundaryConstraintsEnabled property of the diagram view and also we should disable the SizeToContent property of the diagram view, when we use the BoundaryConstraintsArea.

 

Please let us know if you require further assistance on this.

 

Regards,

 

Sudhakar C  



Videos_16486d3f.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;