您的位置:首页 > 其它

如何让ListBoxItem显示序号

2011-10-20 13:40 176 查看
  <ListBox ItemsSource="{Binding}" AlternationCount="{Binding Path=Count}">

<ListBox.ItemTemplate>

<DataTemplate>

<TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem},

Path=(ItemsControl.AlternationIndex)}" />

</DataTemplate>

</ListBox.ItemTemplate>

</ListBox>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐