C# 我可以在其父ListBox.ItemsSource绑定到列表的ListBoxItem上使用IConverter吗<;int>;
我不知道如何绑定到int,因为它没有属性C# 我可以在其父ListBox.ItemsSource绑定到列表的ListBoxItem上使用IConverter吗<;int>;,c#,wpf,xaml,data-binding,C#,Wpf,Xaml,Data Binding,我不知道如何绑定到int,因为它没有属性 <ListBox Name="AgencyTypeListBox" > <ListBox.ItemTemplate > <DataTemplate> <TextBlock Text="{Binding Path=whatDoIPutHere, Converter={BLL:CodeMarkupExtension}}" /> </DataTemplate> </ListB
<ListBox Name="AgencyTypeListBox" >
<ListBox.ItemTemplate >
<DataTemplate>
<TextBlock Text="{Binding Path=whatDoIPutHere, Converter={BLL:CodeMarkupExtension}}" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
在我的代码背后,我这样做
AgencyTypeListBox.ItemsSource = (List<int>) someListofInts;
AgencyTypeListBox.ItemsSource=(List)someListofInts;
如果ItemsSource是一个INT列表,则每个项目的数据上下文将已经是一个整数列表条目;您不需要指定任何路径
如果ItemsSource是一个INT列表,则每个项目的数据上下文将已经是一个整数列表条目;您不需要指定任何路径