Great Karl - worked a treat
From: Karl Heinz Brehme Arredondo [mailto:[email protected]] Sent: 04 June 2011 15:51 To: [email protected]; [email protected] Subject: Re: [MonoTouch] Tableview events - help a newbie On your public ListViewSource constructor you can pass the parent view controller class, and use it public methods and properties inside RowSelected. Some OO people do not like that thing but since all framework has this king of stuff, why do not use it. Like: public class myTableViewSource :UITableViewSource { private List<string> rows; private ParentView parentView; public MyTableViewSource(ParentView parentView, List<string> list) { rows= list; this.parentView = parentView; } //========other methods // === such as rows in section // ====get cell Public override void RowSelected(UITableView tableview,NSIndexPath indexpath) { ShowAlert("row selected ","you selected "+rows[indexPath.Row].toString()); parentView.SelectedIndex = indexPath.Row; parentView.ExecuteSomething (indexPath.Row); } //======= Karl
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
