WPF通过<x:Array>直接为ListBox的ItemsSource赋值

1 <!--其中sys前缀是在xmlns中引入了System的命名空间-->
2 <ListBox.ItemsSource>
3           <x:Array Type="{x:Type sys:String}">
4                   <sys:String>123</sys:String>
5                    <sys:String>123123</sys:String>
6                    <sys:String>111231</sys:String>
7                    <sys:String>1111</sys:String>
8            </x:Array>
9 </ListBox.ItemsSource>
View Code

 

posted @ 2015-12-17 14:17  一菲聪天  阅读(1684)  评论(0编辑  收藏  举报