ViewBox resizes content based on the size it takes. ScrollViewer provides its infinite width / height content for rendering. So, when you put the ViewBox inside the ScrollViewer, the ViewBox thinks it is "all the space in the world" is stretched.
In addition, the ViewBox uses visualization transforms to stretch the content, which means that ScrollViewer will never know the final size of the content.
To make ScrollViewer work, you have to put the width / height in the ViewBox. He must know how much space he takes.
Laith
source share