I have multiple TabItems
in my TabControl
; tabItem1
, tabItem2
, tabItem3
...these are CloseableTabItem
. if all tabitems are aktive, how can i add the tabItem.Header
to a List<string>
?
List<string> listItems = new List<string>();
foreach (TabItem item in tabControl1.Items)
{
if (item.IsEnabled)
listItems.Add(item.Header.ToString());
}