How to open an alert when app is closed in MAUI windows platform ?

דניאל שטרית 306 Reputation points
2023-01-24T15:09:40.1666667+00:00

Hi,

How to open an alert when app is closed in MAUI windows platform ?

I tried OnDisappearing event but exception is thrown.

My scenario is that i want to warn user before closing the app, when something happened.

Thanks,

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
432 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
894 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 65,461 Reputation points
    2023-01-24T18:57:14.6433333+00:00

    With Windows App SDK/WinUI 3, it is

    AppWindow.Closing

    or

    Window.Closed

    You can see OnClosed at Windows

    No comments