I have a WPF TabControl which displays UserControls. Some UserControls are larger than the TabControl and got clipped, so I modified its template by wrapping the ContentPresenter in a ScrollViewer with HorizontalScrollBarVisibility and VerticalScrollBarVisibility set to "Auto".
The problem with this solution is that relative-sized UserControls hosted by the TabControl now gets thousaunds of pixels wider than they are supposed to because the ScrollViewer does not restrict their size.
How can I achieve scrolling of content overflow in a WPF TabControl without its relative-sized content growing out of proportions?
I ended up using the solution described in this blog post:
When to scroll? The problem of infinite-sized UI elements inside a ScrollViewer
To summarize the basic idea: