The following article shows how to create dynamic tabs in WPF so that only one text field is added to each tab.
private TabItem AddTabItem() { int count = _tabItems.Count; // create new tab item TabItem tab = new TabItem(); tab.Header = string.Format("Tab {0}", count); tab.Name = string.Format("tab{0}", count); tab.HeaderTemplate = tabDynamic.FindResource("TabHeader") as DataTemplate; tab.MouseDoubleClick += new MouseButtonEventHandler(tab_MouseDoubleClick); // add controls to tab item, this case I added just a textbox TextBox txt = new TextBox(); txt.Name = "txt"; tab.Content = txt; // insert tab item right before the last (+) tab item _tabItems.Insert(count - 1, tab); return tab; }
http://www.codeproject.com/Articles/493538/Add-Remove-Tabs-Dynamically-in-WPF
What can I do to add some complex controls so that their positions are fixed instead of a single text field? can i create a custom control for this purpose? so how can i add a user control to manage tabs?
source share