Skip to content

Proposal: Add Application.OnUnload or OnExit #9165

Open

Description

Proposal: Add virtual method for application exit in WINUI (C#)

Summary

Be able to hook on application exit just like the existing OnLaunched

Rationale

I'm using an existing code "C" code base using Interop (P/Invoke) calls from our existing system. I need to initialise the "library" on launch, but also need to "shutdown" that library properly when the application exits.
Right now, we're stuck to unload the library using the window close operation. But since we have multiple top level window, we need some weird code to make sure we perform the exit procedure on the "last window to close".

Would be nice to simply do that using an OnExit override on the Application class.

Note

Using WinUI in unpackaged C# application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions