开发者

MEF WPF - Cancel Application.Current.Shutdown() by plugins

开发者 https://www.devze.com 2023-01-04 23:18 出处:网络
are there any ways to cancel Application.Current.Shutdown(); background: i played with mef a little bit and put some plugins to my main app. if any plugin call

are there any ways to cancel

Application.Current.Shutdown();  

background: i played with mef a little bit and put some plugins to my main app. if any plugin call

Application.Current.Shutdown();

my main app shutdown too and i got no chance to cancel this. ar开发者_如何学运维e there any ways?


It don't look like it. So instead of having your plugins do a shutdown, instead have them call some method in your application class that will handle the shutdown request for them. See below link also for more info.

http://www.skylark-software.com/2009/10/canceling-application-shutdown-in-wpf.html

0

精彩评论

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