FrameworkElement.Unloaded Event

Definition

Occurs when this object is no longer connected to the main object tree.

Equivalent WinUI event: Microsoft.UI.Xaml.FrameworkElement.Unloaded.

// Register
event_token Unloaded(RoutedEventHandler const& handler) const;

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

// Revoke with event_revoker
Unloaded_revoker Unloaded(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler Unloaded;
function onUnloaded(eventArgs) { /* Your code */ }
frameworkElement.addEventListener("unloaded", onUnloaded);
frameworkElement.removeEventListener("unloaded", onUnloaded);
- or -
frameworkElement.onunloaded = onUnloaded;
Public Custom Event Unloaded As RoutedEventHandler 
<frameworkElement Unloaded="eventhandler"/>

Event Type

RoutedEventHandler

Remarks

Although this event uses the RoutedEventHandler delegate and RoutedEventArgs as event data, the event is not truly a routed event. It can only be handled on the element that originates the event (in other words, the sender). OriginalSource in event data for this event is always null.

Applies to