Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Captureing Mouseinput on UIElement (Read 3049 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Captureing Mouseinput on UIElement
Nov 13th, 2008 at 3:24pm
Print Post  
Hi

We have some scenarios where mouse inputs need to be handled differently, sometimes the input needs to be captured at the node level, and for this we use the CaptureMouse() method. Is there an 'opposite' of this where the mouse input will be forced through the node to the underlying UIElement?

Many thanks


Paul Eden
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Captureing Mouseinput on UIElement
Reply #1 - Nov 13th, 2008 at 3:55pm
Print Post  
Hi,

Have you tried with node.Locked = true?

Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Captureing Mouseinput on UIElement
Reply #2 - Nov 24th, 2008 at 11:35am
Print Post  
Hi Stoyan

This may be due to the age of our DLLs, but when I set thenodes lock state to true, the mouse input does get through to the UIElement, but it also seems to pass right through the node to the underlying Diagram canvas.  As an example, if the UIElement has a scrollbar in it, attempting to drag the scrollbar will normally move the node at the same time.  Setting the Locked property to true, allows the scrollbar to be move, but also starts to draw a new instance of the diagrams default shape.
Is this expected behaviour, or something that has since been fixed?

Many thanks

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Captureing Mouseinput on UIElement
Reply #3 - Nov 24th, 2008 at 12:34pm
Print Post  
Hi Paul,

The Diagram control starts drawing an item in its PreviewMouseDown handler, which is raised before PreviewMouseDown of child controls. So you might handle this event in your control like this:

Code
Select All
void UIElement_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
	if (diagram.Interaction != null)
		diagram.Interaction.CancelNow();
}
 



This will let you select and move the control node, but will stop the diagram from drawing new items when the mouse is over the hosted control.

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