I want to set the style for the first and last TabItems in TabControl and update them when the visibility of TabItems changes. I see no way to do this with triggers.
What we do is as follows:
| >>> |
And the visibility of TabItems is determined by the binding.
I have it working in code. When changing the visibility of a TabItem, list through TabItems until you find the first visible one. Set the style on this. For all other visible TabItems, set them to a pointy style (so that the previous first visible is now pointy). Then start from the end until you find the visible TabItem and set the last style on it. (This also allows us to solve the problem with TabControl, where the contents of the invisible TabItem will be displayed if none of the visible TabItems is selected.)
Without a doubt, I could improve my methods, but I'm not sure if this is the right approach.
How do you approach this?
source
share