Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的应用程序包含一些需要在视图关闭时清理的对象,如何让 caliburn 在关闭视图时触发事件?这甚至可能吗?具体来说,一旦应用程序关闭,就需要停止一些quartz.net 触发器和计划,但我找不到任何东西。
第一:Quartz.NET 在你的进程中运行,所以当你的进程结束时它无论如何都会停止
第二:您可以让您的 ViewModel 实现IClose并将您的代码放入其中TryClose,或者派生Screen并覆盖OnDeactivate并将代码放入其中。
IClose
TryClose
Screen
OnDeactivate