I have a TabControl with n tabs.
I am trying to limit the TabControl’s width so that if I have only one Tab left, then its header would be always visible when I resize the main window that contains the Tabcontrol.
Any suggestions?
I have a TabControl with n tabs. I am trying to limit the TabControl’s
Share
I would normally hide the tab when only one item is left:
If you want to display something instead you could stack it above and show it only when the count drops to 1.
Edit: I probably should have mentioned that your question does in fact not make all too much sense, you should try to express yourself more clearly. One guess as to what you might have meant is that you want the last remaining tab to stretch the whole available width. This is not that simple because the header is in a TabPanel, it cannot simply be stretched.
One approximation would be to bind to the TabControl’s width:
But this is a bit too large, you might want to subtract a small value by using a ValueConverter.
Edit2: Like this: