public TaskWindow(int boardID, int?taskID, KanbanBoardWindow board) { InitializeComponent(); this.boardID = boardID; this.board = board; // Hide warning labels hideWarningLabels(); if (taskID.HasValue) { // get column position this.taskID = taskID.Value; int columnPos = TaskDO.GetTask(this.taskID).ColumnPos - 1; // Set combobox values comboBox.ItemsSource = ColumnsDO.GetBoardColumnNames(boardID); comboBox.SelectedIndex = columnPos; // Fill the fields fillFields(this.taskID); } else { this.taskID = 0; // set combobox values comboBox.ItemsSource = ColumnsDO.GetBoardColumnNames(boardID); comboBox.SelectedIndex = 0; } }
// Method for pre-filling fields private void fillFields(int taskID) { taskNameInput.Text = TaskDO.GetTask(taskID).TaskName; taskDescriptionInput.Text = TaskDO.GetTask(taskID).TaskDesc; }