As far as I know, this is not a bug of the Prism library, but a normal behavior of the WPF framework.
The TabControl has two
DataTemplates, one for the header and other for the content. The problems seems to be that the
TabControl doesn’t know to which of the two the template must be assigned to, so its assigned to both.
You can check this by adding the following line inside a TabControl:
Like this, the view is created and added to the TabControl through the data template without using Prism at all, however the issue still happens.
As a workaround for this, you can explicitly declare the DataTemplate for the header in the
TabControl like this:
In this case, the TabControl already has a
DataTemplate for the header so the
DataTemplate that instantiates the view is only assigned to the content.
Note that in the example above, the Label used in the header has a fixed string as content, however you can bind the content to a property to change the header accordingly to the view/view model.
I hope you find this useful,