Perhaps my understanding isn’t correct, but after reading the Window section in the docs I would expect calling the window.Close() method should result in the following.
- If WindowCloseAction is None
- Window stays open, Closing and Closed events are not fired
- If WindowCloseAction is Hide
- Windows hides, Closing and Closed events are not fired
- If WindowCloseAction is Disposed
- Windows is disposed, Closing and Closed events are fired
But this isn’t quite what is happening. I have tried this on Windows in Visual Studio and MacOS (intel) in Rider with the following results.
- When calling windowClose():
- If WindowCloseAction is None
- Works as expected
- If WindowCloseAction is Hide
- Closing event is fired, but otherwise works as expected
- If WindowCloseAction is Disposed
- Window hides but is not disposed
- Closed event is not fired but Closing event is fired
- If WindowCloseAction is None
- When Clicking on close box in corner instead of calling Close()
- On Windows: Closing event is not fired, though Closed is fired and window is disposed
- On MacOS: Works as expected, Closing and Closed are fired and window is disposed