You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've registered on the IMainWindow Closing Event to throw up a prompt if a document is dirty when the app closes. If I do want to throw up the prompt, I want to cancel the close event and call close myself when I'm done with the save.
However it seems ControlHostService mainForm_Closing sets e.Cancel to the result of !Close overwriting the value I set. I think ln718 needs to be e.Cancel = e.Cancel || !Close();
Does that sound right?
The text was updated successfully, but these errors were encountered:
Also when the mainform does not cancel and an intervening operation closes the mainform, it seems to interrupt the layout saving causing an exception in subsequent loads. My suggested change in the original post fixes that as well.
Good point, Colin. I'll check in your change shortly. Thanks for the good suggestion.
I assume you made sure that your event handler gets the Closing event before ControlHostService. I wish that the ordering of the listeners didn't matter, but there's no way around that restriction given the IControlHostClient interface. (There's no "CanClose" method.)
I've registered on the IMainWindow Closing Event to throw up a prompt if a document is dirty when the app closes. If I do want to throw up the prompt, I want to cancel the close event and call close myself when I'm done with the save.
However it seems ControlHostService mainForm_Closing sets e.Cancel to the result of !Close overwriting the value I set. I think ln718 needs to be e.Cancel = e.Cancel || !Close();
Does that sound right?
The text was updated successfully, but these errors were encountered: