我有一个导航控制器上显示的表列表O产品,那么我需要触摸的项目的显示这个项目的细节。的MonoTouch获得行项目选择
这是我的如何填写表格代码:因为我用故事板,以显示详细信息视图控制器我有这样的代码在我的表源
public void SearchHotel(){
Hotel hotel = new Hotel();
var distribution = new HotelDistribution[]{new HotelDistribution(){ Adults = 1, Children = 0, ChildrenAges = new int[0]} };
var items = hotel.SearchHotels(Convert.ToDateTime("2013-08-08"),Convert.ToDateTime("2013-09-09 "),"(MIA)", distribution,"","","",0);
data = new List<DtoHotelinformation>();
foreach (var item in items)
{
DtoHotelinformation DtoHotelinformation = new DtoHotelinformation();
DtoHotelinformation.code = item.Code.ToString();
DtoHotelinformation.price = item.Price.ToString();
DtoHotelinformation.title = item.Name.ToString().ToTitleCase();
DtoHotelinformation.subtitle = item.Address.ToString();
DtoHotelinformation.rating = item.Rating.ToString();
DtoHotelinformation.imageUlr = item.ImageUrl;
data.Add(DtoHotelinformation);
}
hud.Hide(true);
hud.RemoveFromSuperview();
HotelSearchTable.Source = new HotelTableSource(data.ToArray());
HotelSearchTable.ReloadData();
}
:
public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
{
if (RowTouched != null) {
RowTouched (this, EventArgs.Empty);
}
tableView.DeselectRow (indexPath, true); // normal iOS behaviour is to remove the blue highlight
}
返回到我的视图控制器我打电话RowTouched以显示详细信息控制器,如下所示:
public override void ViewDidAppear (bool animated) {
base.ViewDidAppear (animated);
SearchHotel();
var source = new HotelTableSource(data.ToArray());
var detail = Storyboard.InstantiateViewController("HotelDetailScreen") as iPhoneHotelDetailViewController;
source.RowTouched += (sender, e) => {
this.NavigationController.PushViewController(detail, true);
};
HotelSearchTable.Source = source;
}
但我需要通过桌面上的项目信息来显示细节。我真的不知道我必须做什么?
注:我不能使用PrepareForSegue因为我没有控制器之间SEGUE。
在此先感谢