- Welcome, Guest. Please Login or Register
MindFusion  
  Version 2 of our Xamarin Calendar component adds Resource view and support for Universal Windows Platform. Now beta testing spreadsheet component for Java Swing.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
SelectionModified event
Read 355 times

milosa   Offline
YaBB Newbies
*
Posts: 5
I Love MindFusion!


   
     
 
SelectionModified event
Mar 16th, 2017 at 2:47pm
 
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!
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 975
Gender: male
tech.support


   
     
 
Re: SelectionModified event
Reply #1 - Mar 16th, 2017 at 5:40pm
 
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
 
 
 
IP Logged    
 
     

milosa   Offline
YaBB Newbies
*
Posts: 5
I Love MindFusion!


   
     
 
Re: SelectionModified event
Reply #2 - Mar 17th, 2017 at 10:52am
 
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.
 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 975
Gender: male
tech.support


   
     
 
Re: SelectionModified event
Reply #3 - Mar 17th, 2017 at 11:36am
 
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 -
http://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
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print