I have a WPF window which I am creating from another window by calling
Show()
, then letting itClose()
itself. When the window closes, I expect it to die, call its destructor, and delete all its child elements (such as timers..).What is the correct way of invoking such an action?
Answer
Close()
releases all unmanaged resources, and closes all owned Window
s.
Any other managed resources you need deterministic disposal of should be handled from the Closed event.
(note: deleted previous answer, it was a completely wrong guess)
Attribution
Source : Link , Question Author : vanja. , Answer Author : mcont