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
原文地址:https://www.cnblogs.com/tommy-huang/p/5054012.html