在我的演示者中,我有这个属性:
public List<string> PropertyNames { get; set; }
我想用这样的 ItemsControl/DataTemplate 列出名称:
<ItemsControl ItemsSource="{Binding PropertyNames}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
由于通用列表没有命名属性,如何在我的 Binding 语句中引用该值?