public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var item = GetItem(indexPath); string cellId = GetCellId(indexPath); BareUITableViewCell cell = tableView.DequeueReusableCell(cellId) as BareUITableViewCell; // If no cells to reuse, create a new one if (cell == null) { switch (cellId) { case CELL_ID_GRADE: cell = new UIGradeCell(CELL_ID_GRADE); break; case CELL_ID_UNASSIGNED: cell = new UITaskCell(CELL_ID_UNASSIGNED); break; } } cell.DataContext = item; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { string cellId = GetCellId(indexPath.Row); BareUITableViewCell cell = tableView.DequeueReusableCell(cellId) as BareUITableViewCell; // If no cells to reuse, create a new one if (cell == null) { switch (cellId) { case CELL_ID_ITEM: cell = new UITaskCell(CELL_ID_ITEM); break; case CELL_ID_HEADER: cell = new UIHeaderCell(CELL_ID_HEADER); break; } } cell.DataContext = GetItem(indexPath.Row); return(cell); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { string cellId = GetCellId(indexPath.Row); BareUITableViewCell cell = tableView.DequeueReusableCell(cellId) as BareUITableViewCell; // If no cells to reuse, create a new one if (cell == null) { switch (cellId) { case CELL_ID_ITEM: cell = new UITaskCell(CELL_ID_ITEM); break; case CELL_ID_HEADER: cell = new UIFriendlyDateHeaderCell(CELL_ID_HEADER); break; case CELL_ID_SHOW_HIDE_OLD_ITEMS_BUTTON: cell = new UIShowHideOldItemsCell(CELL_ID_SHOW_HIDE_OLD_ITEMS_BUTTON, _viewModel.ClassViewModel.ViewItemsGroupClass, _viewModel.Type); break; } } // We don't set data context on the Show Hide old items button, since it already set the data context in its construtor if (cellId != CELL_ID_SHOW_HIDE_OLD_ITEMS_BUTTON) { cell.DataContext = GetItem(indexPath.Row); } return(cell); }
//刷新任务列表 void RefreshTaskList(int SelectedID = -1) { _view.isHaveMainTask.enabled = isHaveCompleteTask(ref MainTaskList); if (_view.isHaveMainTask.enabled) { CurSelected_MainLineCell = null; } _view.isHaveDataTask.enabled = isHaveCompleteTask(ref DayTaskList); if (_view.isHaveDataTask.enabled) { CurSelected_EveryDayCell = null; } if (curTaskType == UITaskType.MainLine) { _view.ShowTaskList(ref MainTaskList, SelectedID); } else if (curTaskType == UITaskType.EveryData) { _view.ShowTaskList(ref DayTaskList, SelectedID); } _view.SetBtnBright((int)curTaskType); //刷新任务按钮提示 Core.Data.taskManager.isHaveTaskComplete = _view.isHaveMainTask.enabled || _view.isHaveDataTask.enabled; //isHaveCompleteTask(ref DayTaskList) || isHaveCompleteTask(ref MainTaskList) ; UITaskBtnState.Refresh(); }