TaskBoard
A task board: the plan as cards in columns, one column for each stage of the work and one card for each task, with lanes across the board by assignee, category or phase.
public partial class TaskBoard : Control
Inherits from / implements: Control
Remarks
A column is a value of Status and a lane is a value of the field LaneBy names, so moving a card changes those fields on the task itself, and a Gantt chart or PERT chart given the same Tasks sees the move. The board schedules the plan as well, so every card shows its finish date and whether it is critical. The board is one tab stop. The arrow keys move between cards; Space picks the current card up, the arrows then carry it - Up and Down within its column, Left and Right between columns, Shift with Up and Down between lanes - and Space or Enter drops it, or Escape puts it back. Enter on a card that is not carried raises TaskActivated. A card can also be dragged with the mouse, a pen or a finger.
Members at a glance
TaskBoard | Creates an empty task board. |
BadgeBrush | The disc behind an assignee's initials. A slate blue by default, under white initials. |
CardBackgroundBrush | The fill of a card. Null, the default, fills cards with the board's Background, so that they follow a light or a dark theme. |
CardBorderBrush | The outline of a card. A light grey by default. |
CardHeight | The height of a card, in logical units. 76 by default, which holds two lines of name, the finish date and the assignee; a card is never drawn shorter than 52. |
ColumnBackgroundBrush | The fill behind each column. A faint, partly transparent grey by default, which tints a light or a dark background alike. |
ColumnWidth | The width of a column, in logical units (1/96 inch). 260 by default; a column is never drawn narrower than 180. |
Columns | The columns, in order, each a Status value with an optional heading and work-in-progress limit. Empty, the default, makes a column of each status the tasks use, in the order they first appear. A task whose status has no column is shown in the first column. Never null. |
CriticalBrush | The stripe along a critical card's leading edge. A red-orange by default. |
Holidays | Dates that are not worked, beside the days WorkingWeek leaves out. Never null; an observable collection is watched. |
IsReadOnly | Stops the reader moving cards; they can still be selected, activated and read. The application can still move them with MoveCard. False by default. |
LaneBy | What the rows of the board are: none, the assignee, the category, or the phase. None by default. |
Links | The links between tasks, which decide each card's dates and whether it is critical. Never null; setting null gives the board an empty list of its own. |
OverLimitBrush | A column's count when it is over its limit, and a place a carried card would be refused. A deep orange by default. |
ProgressBrush | The progress bar along the bottom of a card. A calm blue by default. |
ProjectStart | The first day work can happen. Null starts the plan at its earliest planned date, or today when no task has one. |
Schedule | The plan as last scheduled: every task's dates, its float, and the critical path. Scheduled again first when anything has changed. |
SelectedTask | The selected task, which is also the card the arrow keys move from; null when none is. A task that is not a card - a summary, or one not in Tasks - selects nothing. |
SelectionBrush | The outline of the selected and the carried card, and the mark showing where a carried card would land. Null, the default, uses the system's highlight colour. |
ShowCriticalPath | Marks each card on the critical path with a stripe in CriticalBrush. True by default. |
StrictLimits | Refuses a card to a column that is already at its limit. False by default, when a column may go over its limit and says so in its heading. |
Tasks | The tasks: a flat list in outline order, each naming its parent. Summary tasks are not cards. Never null; setting null gives the board an empty list of its own. |
Today | The date the charts treat as today; null for the computer's own date. The Gantt chart draws its today line here. A board has no timeline and draws nothing for it; the property is here so that one set of settings can be given to all three charts alike. |
VisualChildrenCount | The children are the two scroll bars; everything else is drawn. |
WorkingWeek | The days of the week that are worked. Monday to Friday by default. |
ArrangeOverride | Places the scroll bars, which appear only when the board is larger than the view. |
GetEnumerator | The scroll bars, as logical children, so that they inherit the board's resources and font. |
GetVisualChild | Returns a scroll bar. |
MeasureOverride | Asks for the whole board's size, or the space available when that is less. |
MoveCard | Moves a task's card, exactly as the reader would: CardMoving is raised first and can cancel it, and StrictLimits applies. The move is reported with Application as its source. |
OnCreateAutomationPeer | Gives UI Automation the board as a list of headings and cards. |
OnDpiChanged | Redraws for a new screen density, so text is measured for the pixels it lands on. |
OnGotKeyboardFocus | Shows the focus cue and tells a screen reader which card is current. |
OnKeyDown | The arrows, Home and End move between cards; Space picks the current card up; Enter activates it; the page keys scroll. While a card is carried the arrows carry it, Space or Enter drops it and Escape puts it back. |
OnLostKeyboardFocus | A card carried from the keyboard is put back when the board loses the keyboard: the reader can no longer see or steer where it would go. |
OnLostMouseCapture | A drag ends without a move if something else takes the mouse - a window coming to the front, or the application capturing it. |
OnMouseLeave | Hides the tooltip when the pointer leaves the board. |
OnMouseLeftButtonDown | Selects the card under the pointer; a double-click activates it, and a drag can follow. |
OnMouseLeftButtonUp | Drops a dragged card where the pointer is; a press that never became a drag was just a click. |
OnMouseMove | Starts a drag once the pointer has moved far enough, then carries the card; otherwise follows the pointer for the tooltip. |
OnMouseWheel | Scrolls down and up; with Shift, across. |
OnPropertyChanged | Drops what was resolved from the inherited text and colour settings - the font, the foreground, the background, the language, the reading direction and the text formatting mode - when one changes. |
OnQueryCursor | A hand over a card that can be moved and while one is dragged; "not allowed" over a place that refuses it. |
OnRender | Draws the board: headings over the scrolling body, then a dragged card's copy over both. |
Reschedule | Schedules the plan again now and redraws. Needed only after changing a plain list that does not say when it changes, a task in one, or a BoardColumn's properties. |
ScrollToTask | Scrolls the board, as little as it needs to, so that a task's card is in view. Nothing happens for a task that is not a card. |
CardMoved | Raised after a card has moved and its task has been changed. |
CardMoving | Raised before a card moves, by the pointer, the keyboard or MoveCard. Cancel it to keep the card where it is; nothing has changed yet. |
ScheduleChanged | Raised after the plan has been scheduled again because something changed: a task, a link, a collection, or one of the scheduling settings. |
SelectedTaskChanged | Raised when SelectedTask changes, by the reader or by the application. |
TaskActivated | Raised when the reader double-clicks a card, or presses Enter on the current one. |
BadgeBrushProperty | Identifies the BadgeBrush dependency property. |
CardBackgroundBrushProperty | Identifies the CardBackgroundBrush dependency property. |
CardBorderBrushProperty | Identifies the CardBorderBrush dependency property. |
CardHeightProperty | Identifies the CardHeight dependency property. |
ColumnBackgroundBrushProperty | Identifies the ColumnBackgroundBrush dependency property. |
ColumnWidthProperty | Identifies the ColumnWidth dependency property. |
ColumnsProperty | Identifies the Columns dependency property. |
CriticalBrushProperty | Identifies the CriticalBrush dependency property. |
HolidaysProperty | Identifies the Holidays dependency property. |
IsReadOnlyProperty | Identifies the IsReadOnly dependency property. |
LaneByProperty | Identifies the LaneBy dependency property. |
LinksProperty | Identifies the Links dependency property. |
OverLimitBrushProperty | Identifies the OverLimitBrush dependency property. |
ProgressBrushProperty | Identifies the ProgressBrush dependency property. |
ProjectStartProperty | Identifies the ProjectStart dependency property. |
SelectedTaskProperty | Identifies the SelectedTask dependency property. |
SelectionBrushProperty | Identifies the SelectionBrush dependency property. |
ShowCriticalPathProperty | Identifies the ShowCriticalPath dependency property. |
StrictLimitsProperty | Identifies the StrictLimits dependency property. |
TasksProperty | Identifies the Tasks dependency property. |
TodayProperty | Identifies the Today dependency property. |
WorkingWeekProperty | Identifies the WorkingWeek dependency property. |
Constructors
TaskBoard
Creates an empty task board.
Properties
BadgeBrush
The disc behind an assignee's initials. A slate blue by default, under white initials.
CardBackgroundBrush
The fill of a card. Null, the default, fills cards with the board's Background, so that they follow a light or a dark theme.
CardBorderBrush
The outline of a card. A light grey by default.
CardHeight
The height of a card, in logical units. 76 by default, which holds two lines of name, the finish date and the assignee; a card is never drawn shorter than 52.
ColumnBackgroundBrush
The fill behind each column. A faint, partly transparent grey by default, which tints a light or a dark background alike.
ColumnWidth
The width of a column, in logical units (1/96 inch). 260 by default; a column is never drawn narrower than 180.
Columns
The columns, in order, each a Status value with an optional heading and work-in-progress limit. Empty, the default, makes a column of each status the tasks use, in the order they first appear. A task whose status has no column is shown in the first column. Never null.
BoardColumn does not say when its own properties change; replace it, or call Reschedule.CriticalBrush
The stripe along a critical card's leading edge. A red-orange by default.
Holidays
Dates that are not worked, beside the days WorkingWeek leaves out. Never null; an observable collection is watched.
IsReadOnly
Stops the reader moving cards; they can still be selected, activated and read. The application can still move them with MoveCard. False by default.
LaneBy
What the rows of the board are: none, the assignee, the category, or the phase. None by default.
Links
The links between tasks, which decide each card's dates and whether it is critical. Never null; setting null gives the board an empty list of its own.
OverLimitBrush
A column's count when it is over its limit, and a place a carried card would be refused. A deep orange by default.
ProgressBrush
The progress bar along the bottom of a card. A calm blue by default.
ProjectStart
The first day work can happen. Null starts the plan at its earliest planned date, or today when no task has one.
Schedule
The plan as last scheduled: every task's dates, its float, and the critical path. Scheduled again first when anything has changed.
SelectedTask
The selected task, which is also the card the arrow keys move from; null when none is. A task that is not a card - a summary, or one not in Tasks - selects nothing.
SelectionBrush
The outline of the selected and the carried card, and the mark showing where a carried card would land. Null, the default, uses the system's highlight colour.
ShowCriticalPath
Marks each card on the critical path with a stripe in CriticalBrush. True by default.
StrictLimits
Refuses a card to a column that is already at its limit. False by default, when a column may go over its limit and says so in its heading.
Tasks
The tasks: a flat list in outline order, each naming its parent. Summary tasks are not cards. Never null; setting null gives the board an empty list of its own.
ObservableCollection{T} or a BindingList is watched, and so is every task in it. A plain list is read when it is assigned; call Reschedule after changing one.Today
The date the charts treat as today; null for the computer's own date. The Gantt chart draws its today line here. A board has no timeline and draws nothing for it; the property is here so that one set of settings can be given to all three charts alike.
VisualChildrenCount
The children are the two scroll bars; everything else is drawn.
WorkingWeek
The days of the week that are worked. Monday to Friday by default.
Methods
ArrangeOverride
Places the scroll bars, which appear only when the board is larger than the view.
- arrangeBounds
- The size the board has been given.
Returns. The size used: all of it.
GetEnumerator
The scroll bars, as logical children, so that they inherit the board's resources and font.
GetVisualChild
Returns a scroll bar.
- index
- 0 for the vertical bar, 1 for the horizontal.
Returns. The scroll bar.
MeasureOverride
Asks for the whole board's size, or the space available when that is less.
- constraint
- The space available.
Returns. The size wanted.
MoveCard
Moves a task's card, exactly as the reader would: CardMoving is raised first and can cancel it, and StrictLimits applies. The move is reported with Application as its source.
- task
- The task whose card moves.
- status
- The column to move it to: a
Statuson the board. - lane
- The lane: the value of the
LaneByfield, empty for the lane of tasks without one, or null to keep its lane. Ignored whenLaneByis None. - index
- Its position in the cell, from 0; a negative or too large number puts it last.
Returns. True when the card moved; false when it was cancelled, refused, or is not on the board.
OnCreateAutomationPeer
Gives UI Automation the board as a list of headings and cards.
Returns. The board's automation peer.
OnDpiChanged
Redraws for a new screen density, so text is measured for the pixels it lands on.
- oldDpi
- The density before.
- newDpi
- The density now.
OnGotKeyboardFocus
Shows the focus cue and tells a screen reader which card is current.
- e
- The event data.
OnKeyDown
The arrows, Home and End move between cards; Space picks the current card up; Enter activates it; the page keys scroll. While a card is carried the arrows carry it, Space or Enter drops it and Escape puts it back.
- e
- The key.
OnLostKeyboardFocus
A card carried from the keyboard is put back when the board loses the keyboard: the reader can no longer see or steer where it would go.
- e
- The event data.
OnLostMouseCapture
A drag ends without a move if something else takes the mouse - a window coming to the front, or the application capturing it.
- e
- The event data.
OnMouseLeave
Hides the tooltip when the pointer leaves the board.
- e
- The event data.
OnMouseLeftButtonDown
Selects the card under the pointer; a double-click activates it, and a drag can follow.
- e
- The press.
OnMouseLeftButtonUp
Drops a dragged card where the pointer is; a press that never became a drag was just a click.
- e
- The release.
OnMouseMove
Starts a drag once the pointer has moved far enough, then carries the card; otherwise follows the pointer for the tooltip.
- e
- The move.
OnMouseWheel
Scrolls down and up; with Shift, across.
- e
- The wheel turn.
OnPropertyChanged
Drops what was resolved from the inherited text and colour settings - the font, the foreground, the background, the language, the reading direction and the text formatting mode - when one changes.
- e
- The property that changed.
OnQueryCursor
A hand over a card that can be moved and while one is dragged; "not allowed" over a place that refuses it.
- e
- The event data.
OnRender
Draws the board: headings over the scrolling body, then a dragged card's copy over both.
- drawingContext
- Where to draw.
Reschedule
Schedules the plan again now and redraws. Needed only after changing a plain list that does not say when it changes, a task in one, or a BoardColumn's properties.
ScrollToTask
Scrolls the board, as little as it needs to, so that a task's card is in view. Nothing happens for a task that is not a card.
- task
- The task to show.
Events
CardMoved
Raised after a card has moved and its task has been changed.
CardMoving
Raised before a card moves, by the pointer, the keyboard or MoveCard. Cancel it to keep the card where it is; nothing has changed yet.
ScheduleChanged
Raised after the plan has been scheduled again because something changed: a task, a link, a collection, or one of the scheduling settings.
SelectedTaskChanged
Raised when SelectedTask changes, by the reader or by the application.
TaskActivated
Raised when the reader double-clicks a card, or presses Enter on the current one.
Fields
BadgeBrushProperty
Identifies the BadgeBrush dependency property.
CardBackgroundBrushProperty
Identifies the CardBackgroundBrush dependency property.
CardBorderBrushProperty
Identifies the CardBorderBrush dependency property.
CardHeightProperty
Identifies the CardHeight dependency property.
ColumnBackgroundBrushProperty
Identifies the ColumnBackgroundBrush dependency property.
ColumnWidthProperty
Identifies the ColumnWidth dependency property.
ColumnsProperty
Identifies the Columns dependency property.
CriticalBrushProperty
Identifies the CriticalBrush dependency property.
HolidaysProperty
Identifies the Holidays dependency property.
IsReadOnlyProperty
Identifies the IsReadOnly dependency property.
LaneByProperty
Identifies the LaneBy dependency property.
LinksProperty
Identifies the Links dependency property.
OverLimitBrushProperty
Identifies the OverLimitBrush dependency property.
ProgressBrushProperty
Identifies the ProgressBrush dependency property.
ProjectStartProperty
Identifies the ProjectStart dependency property.
SelectedTaskProperty
Identifies the SelectedTask dependency property.
SelectionBrushProperty
Identifies the SelectionBrush dependency property.
ShowCriticalPathProperty
Identifies the ShowCriticalPath dependency property.
StrictLimitsProperty
Identifies the StrictLimits dependency property.
TasksProperty
Identifies the Tasks dependency property.
TodayProperty
Identifies the Today dependency property.
WorkingWeekProperty
Identifies the WorkingWeek dependency property.