简体   繁体   English

如何使用数据绑定将项目显示为堆栈

[英]How to use data binding to display items as a stack

Is there a way in C#, to dynamically build somehow a stack of items? C#中是否有一种方法可以以某种方式动态构建项目堆栈? Just like a list, but without that scrolling and selecting. 就像列表一样,但无需滚动和选择。

I am searching a way to stack items from a list via binding. 我正在搜索通过绑定从列表中堆叠项目的方法。

And now I want to do this with a stack. 现在,我想使用堆栈进行此操作。

Yeah. 是的 It's called ItemsControl and it has no ScrollViewing + selecting. 它称为ItemsControl,并且没有ScrollViewing +选择。 YOu can do it like: 你可以这样做:

<ItemsControl ItemssSource="{Binding items}">
</ItemsControl>

you probably need to change ItemsControl.ItemTemplate and ItemsControl.ItemPanelsTemplate 您可能需要更改ItemsControl.ItemTemplate和ItemsControl.ItemPanelsTemplate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM