TabView.TabCloseRequested Event

Definition

Raised when the user attempts to close a Tab via clicking the x-to-close button, CTRL+F4, or mousewheel.

C#
public event TypedEventHandler<TabView,TabViewTabCloseRequestedEventArgs> TabCloseRequested;

Event Type

Examples

XAML
<TabView TabCloseRequested="Tabs_TabCloseRequested" />
C#
// Remove the requested tab from the TabView
private void Tabs_TabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args)
{
    sender.TabItems.Remove(args.Tab);
}

Remarks

For more info, design guidance, and code examples, see Tab view.

Use this event to close the requested tab by either removing it from the TabItems collection or from the collection of data items.

Applies to

Produkt Verzie
Windows App SDK 0.8, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6

See also