开发者

How to scroll ItemsControl vertically inside of the Viewbox?

开发者 https://www.devze.com 2023-03-21 06:35 出处:网络
How to let ItemsControl scroll vertically, if it\'s placed in a viewbox? <Viewbox> <ItemsControl ItemsSource=\"...\" />

How to let ItemsControl scroll vertically, if it's placed in a viewbox?

<Viewbox>
    <ItemsControl ItemsSource="..." />
</Viewbox>

I need the Viewbox to scale all the content of my ItemsControl horizontally to the width of the phone (Viewbox does it perfectly, it scales the content in such a way that the widest row of ItemsControl occupies exactly the width, equal to the phone width). But now I cannot scroll the list vertically for some reason, I tried ScrollViewer, scrollbars of Viewbox, scrollbars of ItemsControl -- nothing wor开发者_开发问答ks.


A ViewBox measures its contents, then transforms it so that it fits perfectly within the space available. This will remove the need for scrollbars!

Considering that phones have a fixed screen size, the ViewBox is often redundant. Why not just set an explicit size?

0

精彩评论

暂无评论...
验证码 换一张
取 消