1.sys的程序集:xmlns:sys="clr-namespace:System;assembly=mscorlib"
ListBox的数据呈现可以用:<sys:String></sys:String>或<ListBoxItem Content="" />的形式进程呈现
<ListBox> <ListBoxItem Content="ListBoxItem Method" /> <sys:String>sys:a</sys:String> <sys:String>sys:b</sys:String> <sys:String>sys:c</sys:String> </ListBox>
ListBox绑定数据集
<ListBox Name="lbRoot"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox /> <Image Source="{Binding Img}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
ListBox使用ItemsPanelTemplate改变数据排列方式
<ListBox Name="lbRoot"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox /> <Image Source="{Binding Img}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>