This question is similar to this question I asked earlier today. The difference is, now I would like to delete a Tab Item referenced by it's name
or header
. Can I call Remove
in a fashion similar to the answer I got on this question?
This is what I've tried:
tabControl.Items.Remove = tabControl.Items //Changes tab according to TreeView
.OfType<TabItem>().SingleOrDefault(n => n.Name == stringValue);
Can I use something like this? If so, how?