Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Line Position Changer (Read 5230 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Line Position Changer
Feb 17th, 2010 at 6:45am
Print Post  
Hi Stoyo

How can I implement something like shown in following fig.

In above fig. line marked with  1, can be changed only vertically and line marked with 2 can be changed horizontally.

Regards
Rajesh.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Line Position Changer
Reply #1 - Feb 17th, 2010 at 9:38am
Print Post  
Hi Rajesh,

You can implement that using a custom behavior class:

http://mindfusion.eu/_samples/MyBehavior2.cs
http://mindfusion.eu/Forum/YaBB.pl?board=wpfdg_disc;action=display;num=126200688...

You can skip the if (segment ...) checks for end points if you don't need inserting new segments.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Line Position Changer
Reply #2 - Feb 17th, 2010 at 11:35am
Print Post  
Hi Stoyo

I tried to modify this code for silverlight diagramlite control and having issues like -

1. Cannot get interactionstate for correct segement
    ( From the point in mousedown event extracted the diagram item and for the diagram link item get the nearest segement.

2. In mouse move and mouse up event, cannot able to assign/update values the x and y

Will you please provide me working code for silverlight.

Also, note that I alreday have one custom behavior class in use for node positioning/drag-drop.

-Rajesh
  
Back to top
WWW  
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Line Position Changer
Reply #3 - Feb 18th, 2010 at 12:43pm
Print Post  
Hi Stoyo

Any updates on this issue ? And do you able fix the issue I send you thro' mail.

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Line Position Changer
Reply #4 - Feb 18th, 2010 at 1:36pm
Print Post  
Hi Rajesh,

You can find that code modified for the Silverlight control here:
http://mindfusion.eu/_samples/DragSegmentsBehavior.cs

This version adds the GetLinkAt(ref segment) method:
https://mindfusion.eu/_beta/diaglite14.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Line Position Changer
Reply #5 - Feb 19th, 2010 at 8:48am
Print Post  
Hi Rajesh,

In order to fix the NullReference exception, use the ShapeNode(diagram) constructor when adding shapes to your OrgChartNode.OutItems collection.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Line Position Changer
Reply #6 - Feb 19th, 2010 at 1:55pm
Print Post  
Hi Stoyo

Thanks for the reply of the solution I mailed to you.

The null exception is not occuring now but once mouseup event gets raised I get following exception and not able to get from where it is ocrruing.

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
   at System.Windows.Controls.Canvas.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Line Position Changer
Reply #7 - Feb 21st, 2010 at 12:30pm
Print Post  
Hi Rajesh,

This problem happens because the StrokeDashArray property of geometry objects cannot have a shared DoubleCollection value. The control uses a ValueConverter bound to the property to clone the collections, but somehow it fails in this particular configuration - nodelistview bound to your nodes' OutItems, filled with ShapeNodes initialized from the diagram, without being added to the diagram... We'll try to handle this automatically for the 1.4 release. For now you can work around this by clearing (or cloning) the dash-array value as shown below:

Code
Select All
foreach (DiagramNode node in node1.OutItems)
	node.ClearValue(DiagramItem.StrokeDashArrayProperty);
foreach (DiagramNode node in node2.OutItems)
	node.ClearValue(DiagramItem.StrokeDashArrayProperty); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint