Page 1 of 1

How to add custom code when control destroy?

Posted: 19 Aug 2016, 10:56
by weilitao
Hi,

Since I need to add some custom dispose code when the noesis control destroy. But there is no Dispose method in control class. So what is the better way to implement dispose method?

Re: How to add custom code when control destroy?

Posted: 23 Aug 2016, 18:23
by sfernandez
Hi,

We don't support the Dispose pattern directly in our controls bacause WPF controls doesn't implement it.

Maybe you can wrap your disposable code in another object owned by your controls, and free that part only.
Could this work for you?

Re: How to add custom code when control destroy?

Posted: 23 Aug 2016, 18:31
by tomczak
Hi,

Since I need to add some custom dispose code when the noesis control destroy. But there is no Dispose method in control class. So what is the better way to implement dispose method?
The Unloaded event may help you ?