How to set IsItemsHost in Silverlight
In WPF Panel.IsItemsHost is set-get property. In Silverlight - get only, why I can simulate this in Silverlight? Using in WPF code:
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel IsItemsHost="True" Orientation="Horizontal" />开发者_StackOverflow中文版
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
It was necessary in a previous version of Silverlight to set IsItemsHost="True"
for a panel in an ItemsControl.ItemsPanelTemplate
.
Now the Silverlight controls library fortunately can discover that automatically. One could think that was a no-brainer actually anyway. :->
I don't know if/when WPF will adapt that behavior as well.
Question closed. In ItemsPanelTemplate not neccesary using IsItemHost.
精彩评论