2012-09-16 54 views
0

在C#中有一種方式,動態地構建一堆項目? 就像列表一樣,但沒有滾動和選擇。如何使用數據綁定來顯示項目作爲堆棧

我正在尋找一種方法來通過綁定從列表中堆疊物品。

現在我想用堆棧來做這件事。

+0

什麼是錯的堆棧?我的意思是你可以製作一個通用的對象堆棧。 http://msdn.microsoft.com/en-us/library/3278tedw.aspx – xeon111

+3

滾動?選擇?什麼? – Lucero

+0

不要滾動列表並最終選擇一個項目? – Clue

回答

1

是的。它被稱爲ItemsControl,它沒有ScrollViewing +選擇。 你可以不喜歡它:

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

你可能需要改變ItemsControl.ItemTemplate和ItemsControl.ItemPanelsTemplate

+0

就像這裏我猜:'http:// stackoverflow.com/questions/3356719/bind-collection-to-stackpanel' – Clue

相關問題