2013-02-05 4 views

답변

6

한 가지 방법은 그에게 셀에서 부울 속성을 설정하고 결합하는 것입니다 .... 확인하고 조건에 따라, UITableViewCellAccessory을 제공하려고 :

public bool IsChecked 
    { 
     get { return Accessory == UITableViewCellAccessory.Checkmark; } 
     set { base.Accessory = value ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; } 
    } 

또 다른 방법은 UITableViewCellAssessory

로의 ViewModel 속성을 변환하는 ValueConverter을 설정하는 것입니다
+0

감사합니다 !!! 나는 그것을했다 – Nantharupan

+0

변환기와 두 번째 변종을 시도하고 잘 작동합니다. – Antonio

0

if (//here you check) 
    { // item needed - display checkmark 
     cell.accessoryType = UITableViewCellAccessoryCheckmark; 
    } 
    else 
    { // not needed no checkmark 
     cell.accessoryType = UITableViewCellAccessoryNone; 
    } 
+0

var에 소스 = 새로운 MvxActionBasedBindableTableViewSource ( \t \t \t \t tblLicence, \t \t \t \t UITableViewCellStyle.Subtitle, \t \t \t \t 새로운있는 NSString ("BookListView을"), 붙여 넣기 \t \t \t \t '{'은 titleText ' : { '경로': '이름'}, 'DetailText': { '경로': '주소'}, 'SelectedCommand': { '경로': 'ContactClickCommand'}} ", UITableViewCellAccessory.Checkmark); this.AddBindings (EW 사전 () \t \t \t \t \t { \t \t \t {소스 '{'ItemsSource '{'패스 ''발신자 '}} "}} ) ; \t \t \t tblLicence.Source = source; tblLicence.ReloadData(); 이것은 뷰와 함께 내 ViewModel을 바인딩하는 방법입니다. 내 bool 속성에 따라 CheckMark를 바인딩하려고합니다. – Nantharupan

관련 문제