Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Dragging out of Diagram .. which event handlers can detect it dynamically? (Read 3027 times)
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Dragging out of Diagram .. which event handlers can detect it dynamically?
Mar 1st, 2013 at 10:57am
Print Post  
Hi,

when dragging in WPF the event handlers that would detect that diagram is left or entered, dragover etc are not receiving events until the drag is over aka mouse button is released.

This interferes with e.g. behaviour that the diagram we drag from keeps on scrolling (AutoResize) until the mouse is released, when the system determines "oh its ways outside the diagram" and stops scrolling.

What would be the way to note that mouse position is no more within the diagram WHILE dragging? How to get the real-time feedback?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dragging out of Diagram .. which event handlers can detect it dynamically?
Reply #1 - Mar 1st, 2013 at 1:41pm
Print Post  
I suppose the system does not raise enter/leave events for controls that hold the mouse capture. You could check if the mouse is still inside the control from a MouseMove handler instead:

Code
Select All
void diagram_PreviewMouseMove(object sender, MouseEventArgs e)
{
	var p = e.GetPosition(scrollViewer);
	var r = new Rect(0, 0, scrollViewer.ActualWidth, scrollViewer.ActualHeight);
	if (!r.Contains(p))
		Debug.WriteLine("out");
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Re: Dragging out of Diagram .. which event handlers can detect it dynamically?
Reply #2 - Mar 1st, 2013 at 2:49pm
Print Post  
nice Smiley

but how do you stop AutoResizing on this event?

i just tried AutoResize = AutoResize.None;

but it seems to continue scrolling. Maybe i should arrest the scrollviewer?
  
Back to top
 
IP Logged
 
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Re: Dragging out of Diagram .. which event handlers can detect it dynamically?
Reply #3 - Mar 1st, 2013 at 2:53pm
Print Post  
i mean, it seems to have some leeway before scollviewer end is reached, sort of margin.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Dragging out of Diagram .. which event handlers can detect it dynamically?
Reply #4 - Mar 1st, 2013 at 3:17pm
Print Post  
Is it auto-scrolling or auto-resizing at that point? - perhaps you should set the AutoScroll property to false... I'm not sure what you are trying to do - why not just keep these properties disabled, or do you need some sort of selective auto-scroll and auto-resize?
  
Back to top
 
IP Logged
 
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Re: Dragging out of Diagram .. which event handlers can detect it dynamically?
Reply #5 - Mar 1st, 2013 at 3:36pm
Print Post  
I'll play a bit with it, does not look that bad as before Smiley

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