What is the correct way to dispose of a WPF window?

前端 未结 4 2031
广开言路
广开言路 2020-12-05 17:00

I have a WPF window which I am creating from another window by calling Show(), then letting it Close() itself. When the window closes, I expect it

4条回答
  •  一个人的身影
    2020-12-05 17:42

    There are very few WPF elements that actually need to be explicitly disposed, unlike in Windows Forms.

    In the case of Window, calling Close() is sufficient to dispose all managed and unmanaged resources accorrding to the documentation.

提交回复
热议问题