<ListBox Name="LBNoShowUpList" Grid.Row="1" VerticalContentAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Disabled" >
<ListBox.Background>
<ImageBrush ImageSource="../Assets/Images/测试图片.png"></ImageBrush>
</ListBox.Background>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Name="WPCont" Orientation="Horizontal" HorizontalAlignment="Stretch" >
</WrapPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>//在ItemTemplate下才可以操作数据模板绑定
<DataTemplate>//设定数绑定模板
<!--<WrapPanel Orientation="Vertical">-->
<ListBoxItem Content="{Binding PhoneNo}"/> //绑定具体的字段
<!--</WrapPanel>-->
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
WPF数据绑定方式<ListBox>下
最新推荐文章于 2023-06-12 08:00:00 发布