When can I dispose an IDisposable WPF control e.g. WindowsFormsHost?

后端 未结 4 1102
情书的邮戳
情书的邮戳 2021-01-02 01:38

The WPF control WindowsFormsHost inherits from IDisposable.

If I have a complex WPF visual tree containing some of the above controls what event or method can I use

4条回答
  •  长发绾君心
    2021-01-02 01:54

    You don't need to dispose controls when closing a form, the API will do it for you automatically if the control is in the visual tree of the form ( as a child of the form or other control in the form)

提交回复
热议问题