Can a ScatterViewItem dynamically resize to fit its content?

Posted by Brett on Stack Overflow See other posts from Stack Overflow or by Brett
Published on 2010-03-30T22:09:36Z Indexed on 2010/03/30 22:13 UTC
Read the original article Hit count: 468

Filed under:

We're hosting a control inside of a ScatterViewItem that dynamically changes its size at runtime as a result of having various sub-elements added, removed, and/or collapsed. We would like to have the hosting ScatterViewItem resize as well to properly fit its child controls, but we're having a hard time making this happen. We've tried a number of different things and the closest we've come is hooking into the child control's SizeChanged event and explicitly setting the ScatterViewItem's Width and Height, but this approach still has issues.

When you define a ScatterViewItem and its content in XAML, the ScatterViewItem is sized appropriately. We would like to force the same behavior at runtime when its content changes size. Any help would be greatly appreciated. Thanks!

© Stack Overflow or respective owner

Related posts about microsoft-surface