Is there a clever way to detect whether a window was closed by
- A user pressing the (X) button in the upper right corner of the window or
- window.Close() has been called programatically.
I would like to detect this in the window.Closing handler.
I could set a flag whenever I call window.Close(), but this is not a very pretty solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…