I have a WPF TabControl, with some TabItems. I want margins on the left and right of the TabItems group, if that makes sense.
I'm going to draw some ASCII art below to make the point. I want a fixed margin to the left of tab one, but I also want a fixed margin to the right of tab three.
|--------------------------------------------------|
| |-----||-----||-----| |
| <-Margin-> | 1 || 2 || 3 | <-Margin-> |
|------------| ||-----||-----|-----------------|
| |
| How do I get margin or padding on both |
| sides of my tabs? |
| |
| |
|--------------------------------------------------|
The number of tabs is unlimited, so they will stack as more are added. It needs to work correctly for that.
Also, note, that I don't want to make the whole tab control smaller. Just the tabitem tabs or headers or whatever they are.
I found that if I set the tabs to have a margin of something like "60,0,-60,0", I get the desired effect to the left of the tabs, but that seems like a hack, and won't work for the right hand side.
I am using WPF 4.0 in VS 2010.
Cheers!