0

我正在使用BindingContext来生成表,并且不希望选择默认值。

我的班级有这个领域:

[RadioSelection ("Model:")] 
public int model = -1;
public IList<string> Model; 

然后将其添加到根:

car = new AddCar () {
    Model = new List<string>(){"ES 250","ES 300","ES 330","ES 350"}
};
bc = new BindingContext (this, car, "Add Your Vehicle");
this.Root = bc.Root;

然而,UI 呈现一个选定的值“ES 250”而不是一个空白值:

在此处输入图像描述

4

1 回答 1

2

将 null 或空值添加到列表的开头。否则,您唯一的选择是修改 MT.Dialog 以按照您想要的方式行事。

于 2011-09-09T22:01:15.670 回答