开发者

How to set WP7 ItemsPanel in code behind?

I have a ListBox created in code behind and 开发者_开发百科I need to set the ItemsPanelTemplate to WrapPanel programmatically. Which is the best way to do this?


There's no way to do this in pure code. THe VisualTree property isn't accessible.
(The way you would do this in WPF is to use the FrameworkElementFactory but this is not available in Silverlight.)

The only way to do this appears to be through creating the XAML as a string and then using XamlReader.Load.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜