I want to dynamically add tab item to a tab control just before the last TabItem. I do it like this. I didn't found a better way to do it. At least like with WPF.
The issue is after the item is added. When I click on a TabItem Name, it took the selected style but the TabControl content is not updated anymore.
Removing PageTransition seem solve the issue.
<!-- I need to remove that to be able to add new TabItem -->
<TabControl.PageTransition>
<CrossFade Duration="0.25"/>
</TabControl.PageTransition>
var tabItem = new TabItem()
{
Header = e.Name,
Content = documentViewer,
};
var items = Tabs.Items.Cast<object>().ToList();
items.Insert(items.Count - 1, tabItem);
Tabs.Items = items;
Tabs.SelectedIndex = items.Count - 1;
I want to dynamically add tab item to a tab control just before the last TabItem. I do it like this. I didn't found a better way to do it. At least like with WPF.
The issue is after the item is added. When I click on a TabItem Name, it took the selected style but the TabControl content is not updated anymore.
Removing PageTransition seem solve the issue.
Deps