大佬教程收集整理的这篇文章主要介绍了silverlight – 如何在ListBox中的项目之间显示分隔符?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
将ItemTemplate内容包装在Border控件中并指定BorderThickness和BorderBrush非常容易.我这样做了,因为它不需要在ItemTemplate中更改我的网格.
边框控件在这里描述:http://www.silverlightshow.net/items/Using-the-Border-control-in-Silverlight-2-Beta-1-.aspx.
您可以在下面看到我如何使用它:
<ListBox BACkground="White" Itemssource="{Binding Mode=OneWay,Path=MyPath}" Name="listName" SELEctionChanged="listName_SELEctionChanged"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> </Style> </ListBox.ItemContainerStyle> <ListBox.ItemTemplate> <DataTemplate> here --> <Border BorderThickness="0,10,10" BorderBrush="Black"> <Grid Width="auto" HorizontalAlignment="Stretch" > <Grid.columnDeFinitions> <columnDeFinition Width="auto" /> <columnDeFinition Width="*" /> <columnDeFinition Width="48" /> </Grid.columnDeFinitions> <TextBlock VerticalAlignment="Center" FontSize="36" FontWeight="Bold" Grid.column="0" Foreground="Black" Text="{Binding Path=titlE}" Name="title"/> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Right" Grid.column="1" Foreground="Black" Text="{Binding Path=LOCATIOn}" Name="LOCATIOn"/> <Image VerticalAlignment="Center" Grid.column="2" Width="48" Height="48" source="ApplicationIcon.jpg"/> </Grid> and here --> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
以上是大佬教程为你收集整理的silverlight – 如何在ListBox中的项目之间显示分隔符?全部内容,希望文章能够帮你解决silverlight – 如何在ListBox中的项目之间显示分隔符?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。