2
ObservableCollection<string> CompanyList
后面的xaml.cs代码绑定到xaml中的<ListView>
元素。如果单独放置,则按预期在CompanyList
中显示字符串列表。Xamarin Forms ListView数据绑定
不过,我想在ListView
定制(纯粹为了样式目的)ViewCell
同时留下CompanyList
为string
个集合。我不确定如何绑定string
公司列表值。
<ListView x:Name="CompanyList" ItemTapped="OnAddCompanyFilterTapped" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="0" Spacing="0">
<StackLayout Padding="10">
<Label Text="{Binding ??????????}" HorizontalOptions="Fill"/>
</StackLayout>
<BoxView Style="{StaticResource divider}"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
我把什么放在???????获取CompanyList
中的字符串以显示?
任何帮助/建议/想法,非常感谢!
谢谢!大声笑卡住了这一点,因为我没有一个属性来绑定它“<”。我会接受当Stack允许我(时间要求)。再次感谢! – indubitablee