Caliburn Micro 取消窗口从 ViewModel 关闭
当用户单击窗口的关闭按钮时,是否可以从 ViewModel 取消关闭,还是必须诉诸代码隐藏?
据我所知,CanClose 或 TryClose 并不能解决问题。
When the user clicks the close button of a Window, is it possible to cancel the close from the ViewModel or do I have to resort to code behind?
From what I can tell, CanClose or TryClose doesn't do the trick.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能已经尝试过此操作,但我刚刚创建了一个快速测试,从
Screen
派生视图模型并重写 CanClose。You may have already tried this but I've just created a quick test, deriving a view model from
Screen
and overriding CanClose.