WPF x:Array的使用

<Window x:Class="XamlTest.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        Title="Window1" Height="300" Width="300">
    <Grid>
        <ListBox>
            <ListBox.ItemsSource>
                <x:Array Type="sys:String">
                    <sys:String>zhangsan</sys:String>
                    <sys:String>lisi</sys:String>
                    <sys:String>wangwu</sys:String>
                </x:Array>
            </ListBox.ItemsSource>
        </ListBox>
    </Grid>
</Window>
 

猜你喜欢

转载自www.cnblogs.com/robertyao/p/11715519.html