Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.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.ios 将文本和颜色绑定到列出的项目_Xamarin.ios_Mvvmcross - Fatal编程技术网

Xamarin.ios 将文本和颜色绑定到列出的项目

Xamarin.ios 将文本和颜色绑定到列出的项目,xamarin.ios,mvvmcross,Xamarin.ios,Mvvmcross,如何将标签绑定到颜色和文本?标签位于从xib文件创建的列表中。下面是我将颜色和文本绑定到标签的尝试 我得到一个错误“'eventLabel'与子块中的声明冲突” 公共调度单元(IntPtr句柄):基本(句柄) { 这个.DelayBind(()=>{ var set=this.CreateBindingSet(); set.Bind(eventLabel).To(vm=>vm.EventName); set.Bind(eventLabel) .For(eventLabel=>eventLabel

如何将标签绑定到颜色和文本?标签位于从xib文件创建的列表中。下面是我将颜色和文本绑定到标签的尝试

我得到一个错误“'eventLabel'与子块中的声明冲突”

公共调度单元(IntPtr句柄):基本(句柄) { 这个.DelayBind(()=>{ var set=this.CreateBindingSet(); set.Bind(eventLabel).To(vm=>vm.EventName); set.Bind(eventLabel) .For(eventLabel=>eventLabel.TextColor) .To(vm=>vm.EventType) .具有转换(“EventTypeToColorConverter”); set.Apply(); }); }
错误
'eventLabel'与子块中的声明冲突“
是一个C#错误-这意味着变量名冲突

尝试更改:

            .For(eventLabel => eventLabel.TextColor)

            .For(eventLabel => eventLabel.TextColor)
            .For(eventLabel2 => eventLabel2.TextColor)