public void MoveDown(ITask task) { int index = TasksList.IndexOf(task); if (index < 0) { throw new KeyNotFoundException($"The status detail Id: {task.TaskId} is not found in the task list"); } if (index < TasksList.Count - 1) { TasksList.Swap(index, index + 1); } }
public void MoveUp(ITask task) { int index = TasksList.IndexOf(task); if (index < 0) { throw new KeyNotFoundException($"The task Id: {task.TaskId} is not found in the task list"); } if (index > 0) { TasksList.Swap(index, index - 1); } }
private void Row_DoubleClick(object sender, MouseButtonEventArgs e) { DataGridRow row = (DataGridRow)sender; Task targetTask = (Task)row.Item; int index = TasksList.IndexOf(targetTask); Editting = true; if (OpenTaskDetails(ref targetTask)) { TasksList[index] = targetTask; TaskGrid.Items.Refresh(); } Editting = false; }