Xamarin表单绑定字符串集合c#
我必须将字符串集合绑定到包含带有这些字符串的元素的ListView,但我不知道如何执行此操作:Xamarin表单绑定字符串集合c#,c#,xamarin,xamarin.forms,C#,Xamarin,Xamarin.forms,我必须将字符串集合绑定到包含带有这些字符串的元素的ListView,但我不知道如何执行此操作: name.SetBinding(Label.TextProperty, ??? ); 我知道在xaml中我可以做到这一点 <Label Text="{Binding }"/> CustomCell.cs: public CustomCell() { var name = new Label {
name.SetBinding(Label.TextProperty, ??? );
我知道在xaml中我可以做到这一点
<Label Text="{Binding }"/>
CustomCell.cs:
public CustomCell()
{
var name = new Label
{
TextColor= (Color)Application.Current.Resources["ForegroundColor"],
FontSize = 17
};
name.SetBinding(Label.TextProperty, ??? );
}
“.”绑定路径将属性直接绑定到BindingContext
name.SetBinding(Label.TextProperty, "." );
您应该看看这个
String
没有实现INotifyPropertyChanged
。那适合你吗?
public CustomCell()
{
var name = new Label
{
TextColor= (Color)Application.Current.Resources["ForegroundColor"],
FontSize = 17
};
name.SetBinding(Label.TextProperty, ??? );
}
name.SetBinding(Label.TextProperty, "." );