2013-02-19 2 views
0

Monotouch.Dialog 예제 프로젝트의 OwnerDrawnElement 예제를 사용하고 있습니다 (색상 수정은 그게 전부입니다).Monotouch OwnerDrawnElement Click 이벤트

각 행의 클릭 이벤트를 등록하는 방법을 알고 싶습니다. OwnerDrawnElement은 그렇게하기에 충분히 정교하지 않다고 들었습니다. 나는 확장하고 싶지만 이것이 가능하다는 것을 확신하지 못합니다.

옵션 2 :

MessageElement 내가 할 노력하고있어 훌륭한 작동하지만 것 ... 난 배경 색상을 설정해야하고 나도 그렇게 할 수 있는지 확실하지.

도움을 주시면 대단히 감사하겠습니다.

당신이 함께 OwnerDrawnElement을 확장 할 수 있습니다

답변

2

:

var ownTap = new MyOwnerDrawnElement(); 
ownTap.Tapped += (DialogViewController arg1, UITableView arg2, NSIndexPath arg3) => { 
    Console.WriteLine ("Test"); 
}; 
: 그 탭 이벤트는 다음과 같은 방법으로 설정할 수 있습니다

public event Action<DialogViewController, UITableView, NSIndexPath> Tapped; 
public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) 
{ 
    if (Tapped != null) { 
     Tapped (dvc, tableView, path); 
    } 
    tableView.DeselectRow (indexPath, true); 
}