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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With