【问题标题】:Is there ItemsPanelTemplate that will make the Items uniformly fill the control?是否有 ItemsPanelTemplate 可以使 Items 均匀地填充控件?
【发布时间】:2011-09-28 00:31:25
【问题描述】:

我有一个 ItemsControl,我希望项目均匀地填充控件。 使用 StackPanel 作为 ItemsPanelTemplate 只会向一个方向延伸。

【问题讨论】:

    标签: .net wpf


    【解决方案1】:

    您真正想要的是一个均匀填充的Panel。试试UniformGrid 面板:

    <ItemsControl>
        <ItemsControl.ItemsPanel>
            <ItemsControl.ItemsPanelTemplate>
                <UniformGrid/>
            </ItemsControl.ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
    </ItemsControl>
    

    【讨论】:

      猜你喜欢
      • 2021-05-14
      • 2018-11-24
      • 1970-01-01
      • 2015-02-24
      • 2015-11-19
      • 2017-10-05
      • 1970-01-01
      • 2022-08-11
      • 1970-01-01
      相关资源
      最近更新 更多