0

在我的应用程序中,我已将存储在视图模型中可观察集合中的图像绑定到 xaml 上的列表框,结果是垂直滚动列表(一列),而我想在 2 列视图中显示图像。有没有办法做到这一点?

4

1 回答 1

0

这就是我最终实现它的方式。保持我的图像的大小,以便在 Wrappanel 中仅将两个图像包裹在一行中,使其成为两列。

        <ScrollViewer>
            <ItemsControl ItemsSource="{Binding ImageList}" ItemTemplate="{StaticResource ImageTemplate}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <toolkit:WrapPanel />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
            </ItemsControl>
        </ScrollViewer>
于 2012-08-29T05:38:52.927 回答