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

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

 <!--其中sys前缀是在xmlns中引入了System的命名空间-->
 <ListBox.ItemsSource>
           <x:Array Type="{x:Type sys:String}">
                   <sys:String>123</sys:String>
                    <sys:String>123123</sys:String>
                    <sys:String>111231</sys:String> <sys:String>1111</sys:String> </x:Array> </ListBox.ItemsSource>

猜你喜欢

转载自www.cnblogs.com/lonelyxmas/p/9086189.html