Heya,
I have a WPF application that is using the TabHead/TabItem elements. I want to create new elements at runtime, with the same content as the first element (usually a grid with more elements).
Basicaly I would want the function to look something like this:
public TabItem TabItemAdd(TabControl CHead, TabItem Example, String Header="New Tab" )
{
TabItem item = new TabItem();
item.Content = Example.Content;
item.Header = Header;
CHead.Items.Add(item);
return item;
}
Now I know that this doesn't work because the elements of the TabItem Example are allready childrean of CHead, but I'm not exactly sure how to unbind them or get it to work
Thanks in advance