Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SelectionModified event (Read 2223 times)
milosa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Mar 16th, 2017
SelectionModified event
Mar 16th, 2017 at 1:47pm
Print Post  
Hello,

I have an issue with the events for the selection of the elements on the diagram.
So I want to be able to start an action when the user starts moving the selection of elements (nodes+links) for which SelectionStartModifying event is a good pick. Also I want to be able to react when the modifications to all the elements are done and I would expect that SelectionModified event is fired when all the changes to the events are done.

However the SelectionModified event is fired when we drop the elements (if we talk about dragging and dropping (moving)) but before the actual modifications to the positions of elements are done. Practically it means that you first have a SelectionModified event fired and then NodeModified event for every node that was in the selection (and the same for links).

Is this the desired functionality, because I would expect that SelectionModified is fired after all the NodeModified events?

If this is the desired functionality, do you see a way how I can react when all the changes are applied to all elements in the selection?

Regards!
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: SelectionModified event
Reply #1 - Mar 16th, 2017 at 4:40pm
Print Post  
Hi!

Quote:
but before the actual modifications to the positions of elements are done


What are you judging that from? The Bounds property of nodes should already have its final value at the time SelectionModified is raised, so if you inspect it from the selection event handler it should be correct. The order in which interaction is processed internally looks like this -

Selection.CompleteModify method called
(for each) node.CompleteModify method called
SelectionModified event raised
(for each) NodeModified event raised

Regards,
Slavcho
  
Back to top
 
IP Logged
 
milosa
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Mar 16th, 2017
Re: SelectionModified event
Reply #2 - Mar 17th, 2017 at 9:52am
Print Post  
Hello Slavcho,

I now double checked and it's true that the Bounds are changed for the nodes, however I would expect that the NodeModified events are raised when the bounds change, before the SelectionModified event is raised.

I am handling the change in the bounds of a node (updating my model and so on) in the handler for NodeModified. What I would expect is that when the selection of nodes is moved the same handlers are called to handle change in the bounds of each node and then the SelectionModified is raised so that I can do some final things that are specific for the selection.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: SelectionModified event
Reply #3 - Mar 17th, 2017 at 10:36am
Print Post  
Hi,

So you want SelectionModified raised as some kind of marker indicating you won't get more NodeModified events? We guess that won't hurt anyone, this build reverses their order and will raise selection event last -
https://mindfusion.eu/_beta/wpfdiag_selmod.zip

Now if somebody complains they need SelectionModified raised first, I guess we'll need to add separate pre- and post- events.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint