2011-09-09 3 views
0

BindingContext을 사용하여 테이블을 생성하고 기본값을 선택하지 마십시오.MonoTouch.Dialog : 아니요 기본값

[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"대신 빈 값을 렌더링 그러나 :

내 클래스는이 필드가

enter image description here

답변

2

처음에 null 값이나 빈 값을 추가하십시오. r 목록. 그렇지 않으면 MT.Dialog를 원하는대로 작동하도록 수정하는 것만 가능합니다.