How do you tell if a WPF Window is closed?

前端 未结 7 2028
情深已故
情深已故 2020-12-09 07:27

I\'m working on an application that displays some child windows which can either be closed by the user or are automatically closed. While debugging some exceptions that wer

7条回答
  •  长情又很酷
    2020-12-09 08:02

    Another way : Application.Windows contains a list of open windows. You can check is this collection contains your window (it is removed after closing).

    Looks like you have to call OfType() because it is a specialized collection.

提交回复
热议问题