-api-id | -api-type |
---|---|
E:Microsoft.UI.Xaml.Controls.TabView.TabCloseRequested |
winrt event |
Raised when the user attempts to close a Tab via clicking the x-to-close button, CTRL+F4, or mousewheel.
Use this event to close the requested tab by either removing it from the TabItems collection or from the collection of data items.
<TabView TabCloseRequested="Tabs_TabCloseRequested" />
// Remove the requested tab from the TabView
private void Tabs_TabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args)
{
sender.TabItems.Remove(args.Tab);
}