开发者

override any event of user control when window unloads in wpf

I have a user control and this control is drag-dropped on a window. When this window gets closed, the user control's "Unloaded" event gets fired. I want to override this event in user control (or any other event which gets fired on window close) as i want to write some logic in it before it calls the base.Unloaded event.

The problem is there is no override for "Unloaded" event like "OnUnloaded" in user control.

Is there any other event other than "Unloaded" which gets fired when window closes and that can开发者_StackOverflow中文版 be overriden?


Check if the below links can help

WPF Window.Close() not triggering UserControl.Unloaded event

Disposing WPF User Controls

http://geekswithblogs.net/cskardon/archive/2008/06/23/dispose-of-a-wpf-usercontrol-ish.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜