0
我看到使用MVVMCross模板數據綁定的精彩實例。不過,我有複雜的數據源,設置單元格UI類型可以根據當前正在加載的集合中的項目的性質GetCell(IOS &安卓):MVVMCross定製細胞結合
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
UITableViewCell cell = null;
var item = cellItems [indexPath.Section] [indexPath.Row];
switch (item.DisplayType) {
case DetailType.Name:
cell = tableView.DequeueReusableCell (cellIdentifier + "_name")as NameEditCell;
if (cell == null) {
cell = NameEditCell.Create();
}
((NameEditCell)cell).BindFields (item);
break;
case DetailType.Phone:
cell = tableView.DequeueReusableCell (cellIdentifier + "_phone")as PhoneEditCell;
if (cell == null) {
cell = PhoneEditCell.Create();
}
((PhoneEditCell)cell).BindFields (item);
break;
case DetailType.Email:
cell = tableView.DequeueReusableCell (cellIdentifier + "_email")as EmailEditCell;
if (cell == null) {
cell = EmailEditCell.Create();
}
((EmailEditCell)cell).BindFields (item);
break;
case DetailType.Property:
cell = tableView.DequeueReusableCell (cellIdentifier + "_property")as PropertyEditCell;
if (cell == null)
cell = PropertyEditCell.Create();
((PropertyEditCell)cell).BindFields (item);
break;
case DetailType.Address:
cell = tableView.DequeueReusableCell (cellIdentifier + "_address")as AddressEditCell;
if (cell == null) {
cell = AddressEditCell.Create();
}
((AddressEditCell)cell).BindFields (item);
break;
}
return cell;
}
}
你怎麼會在MVVMCross做到這一點結合或使用示例中描述的模板可以說明綁定到帶有模板的列表?在Android,iOS和Windwos的電話