I have a TabControl and each Tab can contain the same UI but with different data. In any tab the user can click on a button and bring up a popup. This sets a Style property to t
Make sure you're creating a new tab object and you're not trying to insert the same tab into the tab control a 2nd time. A control can only have 1 parent and it seems like the issue is you're trying to insert a tab into either 2 different containers, or more likely the same tab control twice.
To not read all the above the short answer is: you need to change Content
to Template
(in your XAML either style or direct declaration of ContentControl
).
My problem was I was setting the Content
in my Style, and Content
cannot have more then one logical parent. I needed to move that to a Template
instead. Since I didn't want to lose the base style, I set the content in the ContentTemplate
property of the HeaderedContentControl (DraggablePanel in my code).
+1 to Davy anyways for helping me walk through this.