我该如何处理witui 3
这次,我必须将UWP应用程序迁移到Winui 3,到目前为止,除了一些小事情外,一切都很好,但是事件onsuspending
根本没有触发。在命名空间Windows.ui.xaml中,您可以轻松地
this.Suspending += OnSuspending
在app.xaml.cs中使用,这不是问题,在microsoft.ui.xaml中,我不能这样做。现在,我已经在app.xaml.cs中声明了desedeventHandler
,
public event SuspendingEventHandler Suspending;
但这是行不通的。我该如何解决这个问题?
This time I must migrate an UWP App to WinUI 3, so far everything has worked well except for a few small things but the event OnSuspending
is simply not triggered. In the namespace Windows.UI.Xaml you could easily use
this.Suspending += OnSuspending
in app.xaml.cs and it wasn't a problem, in Microsoft.UI.Xaml I can't do this. I have now declared a SuspendingEventhandler
in app.xaml.cs
public event SuspendingEventHandler Suspending;
but this just doesn't work. How can I solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WinUI 3 可用于构建桌面/WIn32 Windows 应用程序(请参阅docs)并且此类应用程序是不暂停 因此不会引发任何
Suspending
事件。WinUI 3 can be used to build desktop/WIn32 Windows apps (see the docs) and this kind of apps are not suspended so there is no
Suspending
event ever being raised.