Hi,
About ContentPane 's ExecutingCommand and Closing events call order, Could you confirm the call order when click Close button in ContentPane?
Now I understand the call order when click Close button: ExecutingCommand event => Closing event => Closed event
In my issue, I need catch Close button click timing (before Closing event) so I think it is ExecutingCommand event.
Hi Cao,
Thank you for posting to Infragistics community.
I have been looking into your question and can confirm that the order of the events is as follows: Executing Command ->Closing -> Closed->Executed Command. I have also created a small sample that demonstrates the timing of each of these events.
The ExecutingCommand event is fired before other events also, such as Pinning a ContentPane (TogglePinnedState command). If you require to use this event to set the Close button click timing, you would have to check the command to be executed and set the time if it is the Closed command:
private void ContentPane_ExecutingCommand(object sender, Infragistics.Windows.Controls.Events.ExecutingCommandEventArgs e) { if(e.Command.Name.Equals("Close")) { this.ClosedUnixTimeMillis = DateTimeOffset.Now.ToUnixTimeMilliseconds(); } }
However, I noticed that the ExecutingCommand and ExecutedCommand events are not fired when a floating ContentPane is closed. Having this in mind, if the ContentPane is allowed to float, it may be better to set the Close button click timing in the Closing event. As you can observe in the sample, the difference in milliseconds between the ExecutingCommand and Closing events is practically insignificant.
Attached you will find my sample for your reference. Please test it on your side and let me know if I may be of any further assistance.
Regards,
Bozhidara Pachilova
Associate Software Developer
5710.XDMContentPaneCloseEvents.zip
Hi Bozhidara,
Thank you for your confirmed and sample.
I 've checked the sample and I undedstood the call order of events as you said.
I will set the Close button click timing in the Closing event because my ContentPane is allowed to float.