2009-10-13 70 views
1

是否可以将OvservableCollection的Labels或FrameworkElement绑定到画布? 如果是这样如何实现?将控件列表绑定到画布

+0

什么叫“绑定”是什么意思?你想让这些物品成为孩子吗?或者你想让他们“分享”一些属性?或者是其他东西? – 2009-10-13 14:55:00

回答

2

您可以使用一个ItemsControl其ItemsPanel属性设置为画布:

<ItemsControl ItemsSource={Binding Items}> 
    <ItemsControl.ItemsPanel> 
    <ItemsPanelTemplate> 
     <Canvas/> 
    </ItemsPanelTemplate> 
    </ItemsControl.ItemsPanel> 
</ItemsControl> 

希望这有助于