Share via


WindowTabManager.TabTearOutRequested Event

Definition

Occurs when the system shell requests a separate window for a specific tab.

// Register
event_token TabTearOutRequested(TypedEventHandler<WindowTabManager, WindowTabTearOutRequestedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
WindowTabManager::TabTearOutRequested_revoker TabTearOutRequested(auto_revoke_t, TypedEventHandler<WindowTabManager, WindowTabTearOutRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<WindowTabManager,WindowTabTearOutRequestedEventArgs> TabTearOutRequested;
function onTabTearOutRequested(eventArgs) { /* Your code */ }
windowTabManager.addEventListener("tabtearoutrequested", onTabTearOutRequested);
windowTabManager.removeEventListener("tabtearoutrequested", onTabTearOutRequested);
- or -
windowTabManager.ontabtearoutrequested = onTabTearOutRequested;
Public Custom Event TabTearOutRequested As TypedEventHandler(Of WindowTabManager, WindowTabTearOutRequestedEventArgs) 

Event Type

Examples

if (WindowTabManager::IsTabTearOutSupported())
{
    m_tabTearOutRequestedRevoker = m_tabManager.TabTearOutRequested(winrt::auto_revoke, { this, &MainWindow::TabTearOutRequested });
}

Remarks

Important

This API is for Win32 desktop apps only. UWP and other app types are not supported.

A tab tear out request can happen when tabs show in the Snap Assist tool and the user chooses to have a specific tab snapped in a different window.

Not all versions of Windows support the scenarios that raise this event, so call IsTabTearOutSupported before subscribing to the TabTearOutRequested event and subscribe only if it returns true.

If your app does not support tab tear out, its tabs will not show in Snap Assist.

Applies to