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

前端 未结 4 2027
广开言路
广开言路 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条回答
  •  猫巷女王i
    2020-12-05 17:45

    Close() releases all unmanaged resources, and closes all owned Windows.

    Any other managed resources you need deterministic disposal of should be handled from the Closed event.

    Reference

    (note: deleted previous answer, it was a completely wrong guess)

提交回复
热议问题