Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin表单绑定字符串集合c#_C#_Xamarin_Xamarin.forms - Fatal编程技术网

Xamarin表单绑定字符串集合c#

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 {

我必须将字符串集合绑定到包含带有这些字符串的元素的ListView,但我不知道如何执行此操作:

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, "." );