This seems does not work: TabItem tabItem = new TabItem(); tabItem.Header = "New tab"; tabItem.Content = "Content"; tabControl.Items.Add(tabItem);
Anyone has done adding TabItem dynamically to a TabControl?
This seems does not work: TabItem tabItem = new TabItem(); tabItem.Header = "New tab"; tabItem.Content = "Content"; tabControl.Items.Add(tabItem);
Anyone has done adding TabItem dynamically to a TabControl?
Works for me
TabItem item = new TabItem();
item.Header = "Test Header";
item.Content = "Some Text";
Tabs.Items.Add(item);
TabControl tc = new TabControl(); tc.Width = 400; tc.Height = 300;
TabItem ti = new TabItem();
ti.Header = "Tab Header";
ti.Content = "Tab Content";
tc.Items.Add(ti);
LayoutRoot.Children.Remove(tc);
LayoutRoot.Children.Add(tc);