When executing ContentPaneCommands.Close, the handler for the closing event of the pane can cancel the event. I need to know if there is a way to dig out the cancellation of that event from the code that executes ContentPaneCommands.Close, which returns a boolean that is not related to cancellation of the Closing event.
void Window_Closing(object sender, CancelEventArgs e)
{
foreach (var pane in dockManager.GetPanes(PaneNavigationOrder.VisibleOrder))
pane.ExecuteCommand(ContentPaneCommands.Close);
// need ability to detect cancellation from Closing event below and issue e.Cancel = true here
}
void Pane_Closing(object sender, PaneClosingEventArgs e)
// for whatever reason ...
e.Cancel = true;
My current solution is to simply check the panes at the end of Window_Closing. A shared flag is another, albeit less elegant solution.
Hello Darryl,
Thank you for your reply. I am very glad that you have managed to solve the issue that you were having . Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Just a note that in my haste to post this, I broke the fundamental rule of iteration: don't modify the collection you're iterating. GetPanes() into a List, then iterate the list and close them.