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>
 
posted @ 2019-10-21 19:36  willamyao  阅读(335)  评论(0编辑  收藏  举报