DispatcherQueue.ShutdownCompleted Event


Fires after the DispatcherQueue event loop stops which is the last step in the DispatcherQueue shutdown process.

Equivalent WinUI event: Microsoft.System.DispatcherQueue.ShutdownCompleted.

// Register
event_token ShutdownCompleted(TypedEventHandler<DispatcherQueue, IInspectable const&> const& handler) const;

// Revoke with event_token
void ShutdownCompleted(event_token const* cookie) const;

// Revoke with event_revoker
DispatcherQueue::ShutdownCompleted_revoker ShutdownCompleted(auto_revoke_t, TypedEventHandler<DispatcherQueue, IInspectable const&> const& handler) const;
public event TypedEventHandler<DispatcherQueue,object> ShutdownCompleted;
function onShutdownCompleted(eventArgs) { /* Your code */ }
dispatcherQueue.addEventListener("shutdowncompleted", onShutdownCompleted);
dispatcherQueue.removeEventListener("shutdowncompleted", onShutdownCompleted);
- or -
dispatcherQueue.onshutdowncompleted = onShutdownCompleted;
Public Custom Event ShutdownCompleted As TypedEventHandler(Of DispatcherQueue, Object) 

Event Type




// Invoked after the DispatcherQueue event loop exits.
_dispatcherQueue.ShutdownCompleted += (s, e) =>
    // clean up state


The event is fired on the thread running the DispatcherQueue event loop. After this event is fired, any work posted to the DispatcherQueue will not be scheduled.

Applies to