-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Milestone
Description
I have a MetroAnimatedSingleRowTabControl in my Window and from a UserControl I add programmaticaly a MetroTabItem to it like so:
object foundTabControl = parentWindow.FindName("metroAnimatedSingleRowTabControl");
MetroAnimatedSingleRowTabControl metroAnimatedSingleRowTabControl = (MetroAnimatedSingleRowTabControl)foundTabControl;
MetroTabItem metroTabItem = new MetroTabItem();
metroTabItem.Content = newSomeUserControl;
metroTabItem.CloseButtonEnabled = true;
metroAnimatedSingleRowTabControl.Items.Insert(index,metroTabItem);
metroAnimatedSingleRowTabControl.SelectedIndex = index;
metroAnimatedSingleRowTabControl.Items.MoveCurrentToLast();
When I close this tab I get a InvalidOperationException saying that Operation is not valid due to the current state of the object.
The other tabs added from XAML don't have a close button but if I set the CloseButtonEnabled="True" it's working. The problem is just with the TabItems added from the child.
Is this a limitation or I just lack the knowledge to do this?
Metadata
Metadata
Assignees
Labels
No labels