I have a WPF TabControl who's TabItems are MEF'd in at run time. However, they are MEF'd in only when a certain item in a left-hand treeview is selected. What I'd like to do is display a centered message inside the TabControl indicating "No Active Scenario Selected". I tried adding a TextBlock inside the TabControl but what I got was a TabItem instead. Any ideas?
0
votes
1 Answers
2
votes
One way to do this is simply by putting a TextBlock
on top of the TabControl
and show it when the TabControl
doesn't have any Tabs added.
You can bind the Visibility
of the TextBlock
to the HasItems
property of the TabControl
and use a value converter (BooleanToVisibilityConverter or your own implementation) to show and hide the TextBlock
.