Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Exception in implementation of custom behaviour (Read 1696 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Exception in implementation of custom behaviour
Feb 19th, 2010 at 10:48am
Print Post  
Hi Stoyo

When custom behaviour is implemented and only OnMouseDown function is overriden and it returns "false" I get following exception when mouseUp function of BaseBehaviour gets invoked.

-----------
  at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Nullable`1.get_Value()
   at MindFusion.Diagramming.Silverlight.BehaviorBase.OnMouseUp(MouseButtonEventArgs e)
   at Tutorial3.DragSegmentsBehavior1.OnMouseUp(MouseButtonEventArgs e)
   at MindFusion.Diagramming.Silverlight.Diagram.x66c89b500bffc63d(Object xe0292b9ed559da7d, MouseButtonEventArgs xfbf34718e704c6bc)
   at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
-----------

By overriding mouseUp event in custom behavior class and not calling base.MouseUp(e) works properly.

In my custombehavior class, I am implementing different type of possiblities and to avoid above exception I need to declare some varilable which controls this bug.
Will you please make sure this issue gets fixed in release 1.4

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exception in implementation of custom behaviou
Reply #1 - Feb 19th, 2010 at 11:10am
Print Post  
Hi Rajesh,

Try calling base.OnMouseDown before returning false.

Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Exception in implementation of custom behaviou
Reply #2 - Feb 19th, 2010 at 11:17am
Print Post  
Hi Stoyo

if I call base.OnMouseDown(e) before returning false, it will start the default behaviour.

For eq. deriving my class from LinkShapesBehaviour will start creating link if mouse down event occurs on node and if mousedown is somewhere in diagram then, new node creation behaviour gets trigerred.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exception in implementation of custom behaviou
Reply #3 - Feb 19th, 2010 at 2:01pm
Print Post  
Hi Rajesh,

Actually the default behavior starts in the first MouseMove. Try moving your MouseDown logic to MouseMove, with an additional check if InteractionState is still null, and do not call the base implementation if nothing should happen.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint