Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic WPF Diagram with Scroll (Read 2969 times)
Chith
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Nov 10th, 2010
WPF Diagram with Scroll
Nov 10th, 2010 at 9:42am
Print Post  
Hi

Please let know how to freeze frist column of the WPFDiagram while scroll
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: WPF Diagram with Scroll
Reply #1 - Nov 10th, 2010 at 9:45am
Print Post  
Do you mean you have arranged your nodes in columns, and the nodes from the first column should not scroll?
  
Back to top
 
IP Logged
 
Chith
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Nov 10th, 2010
Re: WPF Diagram with Scroll
Reply #2 - Nov 18th, 2010 at 11:44am
Print Post  
Thanks, I have done that using two grids. How to enable only left  to right and right to left move in Diagram not Top to bottom and bottom to Top.
  
Back to top
 
IP Logged
 
Chith
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Nov 10th, 2010
Re: WPF Diagram with Scroll
Reply #3 - Nov 18th, 2010 at 11:47am
Print Post  
Using this code i have achieve the freez first column

Point p=new Point(0.0,diagram.ScrollY);
Rolediagram.ScrollTo(p);
  
Back to top
 
IP Logged
 
Chith
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Nov 10th, 2010
Re: WPF Diagram with Scroll
Reply #4 - Nov 18th, 2010 at 11:50am
Print Post  
Please let me know any events for moving nodes
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: WPF Diagram with Scroll
Reply #5 - Nov 18th, 2010 at 6:39pm
Print Post  
Quote:
How to enable only left  to right and right to left move in Diagram not Top to bottom and bottom to Top.


Set node.Constraints.MoveDirection.

Quote:
Please let me know any events for moving nodes.


There's the NodeModified event raised when a node is moved or resized.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Chith
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Nov 10th, 2010
Re: WPF Diagram with Scroll
Reply #6 - Nov 19th, 2010 at 4:21am
Print Post  
Thanks , this is the code

private void diagram_NodeModifying(object sender, NodeValidationEventArgs e)
       {
           try
           {
               ShapeNode task = (ShapeNode)e.Node;
               Point p=e.MousePosition;
               if (p.Y != ((DiagramNode)(task)).Bounds.Y)
               {
                   e.CancelDrag();
               }
              
           }
           catch
           {

           }
       }

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: WPF Diagram with Scroll
Reply #7 - Nov 19th, 2010 at 7:15am
Print Post  
This code will make it very hard for the user to move a node. Set node.Cosntraints.MoveDirection = DirectionConstraint.Horizontal to allow only horizontal node movement.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Chith
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Nov 10th, 2010
Re: WPF Diagram with Scroll
Reply #8 - Nov 19th, 2010 at 8:50am
Print Post  
Thnaks Stoyan Its working fine
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint