HypernovaDesktop Components · docs
Binarymission
WPF › Project Management › TaskBoard

TaskBoard

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.ProjectManagement

A task board: the plan as cards in columns – one column for each stage of the work, one card for each task – with optional lanes across the board by assignee, category or phase, and cards that move with the mouse or the keyboard.

public partial class TaskBoard : Control

Inherits from / implements: Control

Remarks

Use it for the day-to-day running of a plan: what is waiting, what is in hand, what is done, and who has what. Because it reads the same plan as a GanttChart and a PertChart, every card also knows its finish date and whether it is on the critical path.

Columns and lanes are fields of the task

A column is a value of ProjectTask.Status, and a lane is a value of the field LaneBy names – ProjectTask.Assignee, ProjectTask.Category, or the top-level summary a task sits in. So moving a card is nothing more than changing those fields on your own task object, and a Gantt chart given the same Tasks sees the move at once. The order of cards within a column is ProjectTask.Rank, which nothing else reads, so tidying a board never moves a date. Summary tasks are not cards: on a board, structure is what lanes are for.

Columns

Describe the workflow in Columns, each a BoardColumn with a status, an optional heading and an optional work-in-progress limit. Leave it empty and the board makes a column for each status the tasks use; with none at all it shows To do, In progress and Done. A task whose status has no column is shown in the first. A column over its limit says so in its heading, and StrictLimits refuses cards to a column that is full.

Moving cards

Drag a card with the mouse, a pen or a finger; the board scrolls when a card is carried to its edge. From the keyboard, the arrows move between cards and Space picks the current one 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 Esc puts it back. Every move, however it is made and including MoveCard, is offered first through CardMoving, which can cancel it, and announced by CardMoved; each step of a keyboard move is also said aloud to a screen reader. IsReadOnly stops the reader moving cards.

What a card shows

The task's name on up to two lines, its finish date (after a diamond for a milestone), the assignee's initials in a badge, a progress strip along the foot, and – with ShowCriticalPath on – a stripe in CriticalBrush down the leading edge of a critical task. Double-click a card, or press Enter on it, to raise TaskActivated.

Appearance

The board draws itself and has no template. Cards take Control.Background unless CardBackgroundBrush is set, text takes Control.Foreground and the font, and dates are written in the culture of FrameworkElement.Language when it is set, otherwise the current culture. In Windows high contrast the system colours replace every brush. With FrameworkElement.FlowDirection right to left the first column is on the right and the arrow keys follow.

Examples

A board for a website relaunch, with a limit of three cards in progress and a lane for each person. The Tasks and Links are the same collections a Gantt chart elsewhere in the window shows.

<Window x:Class="Planner.BoardWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:pm="clr-namespace:Binarymission.WPF.Controls.ProjectManagement;assembly=Binarymission.WPF.Controls.ProjectManagement"
        Title="Relaunch board" Width="1100" Height="700">

    <pm:TaskBoard x:Name="board"
                  Tasks="{Binding Tasks}"
                  Links="{Binding Links}"
                  ProjectStart="2026-11-02"
                  LaneBy="Assignee"
                  StrictLimits="True"
                  ColumnWidth="240"
                  CardMoving="OnCardMoving"
                  CardMoved="OnCardMoved">
        <pm:TaskBoard.Columns>
            <pm:BoardColumn Status="Backlog" />
            <pm:BoardColumn Status="Doing" Header="In progress" Limit="3" />
            <pm:BoardColumn Status="Review" Limit="2" />
            <pm:BoardColumn Status="Done" />
        </pm:TaskBoard.Columns>
    </pm:TaskBoard>
</Window>

The code-behind: a rule the application keeps, and saving the task once it has moved.

private void OnCardMoving(object sender, CardMovingEventArgs e)
{
    // Only finished work can be passed for review.
    if (e.ToStatus == "Review" && e.Task.Progress < 100)
    {
        e.Cancel = true;
        MessageBox.Show(e.Task.Name + " is " + e.Task.Progress + "% done; finish it before review.");
    }
}

private void OnCardMoved(object sender, TaskEventArgs e)
{
    // Status, Assignee and Rank are already set on the task: store it.
    repository.Save(e.Task);
}

See also

Members at a glance

Constructors
TaskBoardCreates an empty task board, with empty Tasks, Links, Holidays and Columns collections of its own and no lanes.
Properties
BadgeBrushGets or sets the fill of the disc that shows the assignee's initials at the foot of a card.
CardBackgroundBrushGets or sets the fill of every card.
CardBorderBrushGets or sets the outline of a card that is not selected, and – fainter – the track behind its progress strip.
CardHeightGets or sets the height of every card.
ColumnBackgroundBrushGets or sets the fill behind each column, from its heading to the foot of the board.
ColumnWidthGets or sets the width of every column, and so of every card in it.
ColumnsGets or sets the board's columns, in order: each a ProjectTask.Status value, with an optional heading and work-in-progress limit.
CriticalBrushGets or sets the colour of the stripe down the leading edge of a card on the critical path, while ShowCriticalPath is on.
HolidaysGets or sets the dates that are not worked, beside the days WorkingWeek leaves out.
IsReadOnlyGets or sets whether the reader can only look at the board and not move cards.
LaneByGets or sets what the board's rows, its lanes, stand for: nothing, the assignee, the category, or the phase – the top-level summary a task sits in.
LinksGets or sets the links between the tasks, which decide each card's finish date and whether it is critical.
OverLimitBrushGets or sets the colour of a column's count, and a bar under its heading, while it holds more cards than its BoardColumn.Limit; and of the outline of a carried card over a column that would refuse it.
ProgressBrushGets or sets the fill of the progress strip along the foot of a card, which fills from the leading edge with the task's ProjectTask.Progress.
ProjectStartGets or sets the first day work on the plan can happen, from which the cards' finish dates are worked out.
ScheduleGets the plan as scheduled: every task's dates and float, the critical path, and what in the input could not be used.
SelectedTaskGets or sets the selected task: the outlined card, which the arrow keys move from and Space picks up.
SelectionBrushGets or sets the outline of the selected card and of a card being carried, and the mark showing where a carried card would land.
ShowCriticalPathGets or sets whether each card on the critical path has a stripe in CriticalBrush down its leading edge.
StrictLimitsGets or sets whether a column's work-in-progress limit is enforced, refusing a card to a column that is already full.
TasksGets or sets the tasks of the plan: a flat list in outline order, in which a subtask names its summary through ProjectTask.ParentId.
TodayGets or sets the date the charts treat as today. A board has no timeline and draws nothing for it.
VisualChildrenCountGets the number of child elements: the vertical and the horizontal scroll bar. Everything else is drawn.
WorkingWeekGets or sets the days of the week on which work happens.
Methods
ArrangeOverridePlaces the scroll bars, which appear only when the board is larger than its view, and carries out a scroll asked for before the board had a size.
GetEnumeratorGets the two scroll bars, as logical children, so that they take the board's resources and styles.
GetVisualChildReturns one of the two scroll bars.
MeasureOverrideAsks for the whole board's size – every column, and every lane with its cards – or for the room available when that is less.
MoveCardMoves a task's card, exactly as the reader would: CardMoving is raised first and can cancel it, StrictLimits applies, and CardMoved follows.
OnCreateAutomationPeerGives UI Automation the board as a list of column headings and cards, so that a screen reader can read the board and follow a card being moved.
OnDpiChangedRedraws for a new display scale, so that text is measured for the pixels it lands on.
OnGotKeyboardFocusShows the focus cue and tells a screen reader which card is current.
OnKeyDownCarries out the board's keys. With no card carried: the arrows, Home and End move between cards, Space picks the current card up, Enter activates it, and Page Up and Page Down scroll. While a card is carried: the arrows carry it, Space or Enter drops it, and Esc puts it back.
OnLostKeyboardFocusPuts back a card carried from the keyboard when the board loses the focus, since the reader can no longer see or steer where it would go.
OnLostMouseCaptureEnds a drag without a move when something else takes the mouse – a window coming to the front, or the application capturing it.
OnMouseLeaveHides the tooltip when the pointer leaves the board.
OnMouseLeftButtonDownSelects the card under the pointer, raising TaskActivated on a double-click; a drag can follow. A press while a card is carried from the keyboard puts that card back.
OnMouseLeftButtonUpDrops a dragged card where the pointer is, through CardMoving. A press that never became a drag was just a click.
OnMouseMovePicks a pressed card up once the pointer has moved the system's drag distance, then carries it, scrolling at the edge of the view; otherwise shows, after the hover time, a tooltip describing the card under the pointer.
OnMouseWheelScrolls up and down, 48 logical units a notch; with Shift, scrolls sideways.
OnPropertyChangedRedraws when a setting the drawing reads from the control itself changes: the font, Foreground, Background, FrameworkElement.Language, FrameworkElement.FlowDirection or the text formatting mode.
OnQueryCursorShows a hand over a card that can be moved and while one is dragged, and the "not allowed" cursor over a place that would refuse the card.
OnRenderDraws the board: the column headings, fixed above the scrolling lanes and cards, then a dragged card's copy over both.
RescheduleSchedules the plan again now and lays the board out again.
ScrollToTaskScrolls the board, as little as it needs to, so that a task's card is in view below the column headings.
Events
CardMovedOccurs after a card has moved and its task's fields have been changed.
CardMovingOccurs when a card is about to move – dropped by the pointer or the keyboard, or moved by MoveCard – before anything has changed. Cancel it to keep the card where it is.
ScheduleChangedOccurs after the plan has been scheduled again because something changed: a task, a link, one of the lists, or a scheduling setting.
SelectedTaskChangedOccurs when SelectedTask changes: the reader chose another card, the application set the property, or the selected task left the board.
TaskActivatedOccurs when the reader asks to open a task: by double-clicking its card, or by pressing Enter on the current card when none is being carried.
Fields
BadgeBrushPropertyIdentifies the BadgeBrush dependency property.
CardBackgroundBrushPropertyIdentifies the CardBackgroundBrush dependency property.
CardBorderBrushPropertyIdentifies the CardBorderBrush dependency property.
CardHeightPropertyIdentifies the CardHeight dependency property.
ColumnBackgroundBrushPropertyIdentifies the ColumnBackgroundBrush dependency property.
ColumnWidthPropertyIdentifies the ColumnWidth dependency property.
ColumnsPropertyIdentifies the Columns dependency property.
CriticalBrushPropertyIdentifies the CriticalBrush dependency property.
HolidaysPropertyIdentifies the Holidays dependency property.
IsReadOnlyPropertyIdentifies the IsReadOnly dependency property.
LaneByPropertyIdentifies the LaneBy dependency property.
LinksPropertyIdentifies the Links dependency property.
OverLimitBrushPropertyIdentifies the OverLimitBrush dependency property.
ProgressBrushPropertyIdentifies the ProgressBrush dependency property.
ProjectStartPropertyIdentifies the ProjectStart dependency property.
SelectedTaskPropertyIdentifies the SelectedTask dependency property.
SelectionBrushPropertyIdentifies the SelectionBrush dependency property.
ShowCriticalPathPropertyIdentifies the ShowCriticalPath dependency property.
StrictLimitsPropertyIdentifies the StrictLimits dependency property.
TasksPropertyIdentifies the Tasks dependency property.
TodayPropertyIdentifies the Today dependency property.
WorkingWeekPropertyIdentifies the WorkingWeek dependency property.

Constructors

TaskBoard

public TaskBoard()

Creates an empty task board, with empty Tasks, Links, Holidays and Columns collections of its own and no lanes.

Remarks

Each board gets collections of its own, so a column added to one board is never added to another. To share a plan, give several boards and charts the same task and link lists.

Properties

BadgeBrush

public Brush BadgeBrush

Gets or sets the fill of the disc that shows the assignee's initials at the foot of a card.

Value
The default is a slate blue, #4C6A92, under white initials. null uses the system highlight colour.
Remarks

The initials are always white, so choose a fill they read on. A card whose task has no ProjectTask.Assignee has no badge. In Windows high contrast the system colours are used instead.

CardBackgroundBrush

public Brush CardBackgroundBrush

Gets or sets the fill of every card.

Value
The default is null: cards take the board's Background, or the system window colour when that is not set, so they follow a light or a dark theme.
Remarks

A card's text is drawn in Foreground; choose a fill it reads on. In Windows high contrast the system colours are used instead.

CardBorderBrush

public Brush CardBorderBrush

Gets or sets the outline of a card that is not selected, and – fainter – the track behind its progress strip.

Value
The default is a light grey, #A9B4BF. null uses the system's dark control colour.
Remarks

In Windows high contrast the system colours are used instead.

CardHeight

public double CardHeight

Gets or sets the height of every card.

Value
In logical units (1/96 inch). The default is 76, which holds two lines of name above the finish date and the assignee's badge. A card is never drawn shorter than 52, which holds one line of name.
Remarks

A negative value, NaN or an infinity is refused with an ArgumentException.

ColumnBackgroundBrush

public Brush ColumnBackgroundBrush

Gets or sets the fill behind each column, from its heading to the foot of the board.

Value
The default is a faint grey at 10% opacity (#1A7F8C99), which tints a light or a dark background alike. null leaves columns untinted.
Remarks

In Windows high contrast the system colours are used instead.

Example
<pm:TaskBoard Background="#F7F8FA" ColumnBackgroundBrush="#EEF1F5" CardBackgroundBrush="White"
              CardBorderBrush="#D0D7DE" BadgeBrush="#1565C0" OverLimitBrush="#C62828" />

ColumnWidth

public double ColumnWidth

Gets or sets the width of every column, and so of every card in it.

Value
In logical units (1/96 inch). The default is 260. A column is never drawn narrower than 180, the room a card's name needs.
Remarks

The board scrolls sideways when its columns are wider than it is. A negative value, NaN or an infinity is refused with an ArgumentException.

Columns

public ObservableCollection<BoardColumn> Columns

Gets or sets the board's columns, in order: each a ProjectTask.Status value, with an optional heading and work-in-progress limit.

Value
The columns. The default is an empty collection of the board's own; setting null gives a new empty one, so it is never null.
Remarks

Empty, the board makes a column for each status the tasks use, in the order they first appear, or To do, In progress and Done when no task has one. A column with no status, or a status already used, is ignored. A task whose status has no column is shown in the first column, so no card is ever off the board.

Adding, removing and replacing columns is seen at once and puts back a card being carried. A BoardColumn does not say when its own properties change; replace it, or call Reschedule.

Example
board.Columns.Add(new BoardColumn("Backlog"));
board.Columns.Add(new BoardColumn("Doing", 3) { Header = "In progress" });
board.Columns.Add(new BoardColumn("Done"));
See also

CriticalBrush

public Brush CriticalBrush

Gets or sets the colour of the stripe down the leading edge of a card on the critical path, while ShowCriticalPath is on.

Value
The default is a red-orange, #E0512B. null uses the system's hot-track colour.
Remarks

In Windows high contrast the system colours are used instead.

Holidays

public IList<DateTime> Holidays

Gets or sets the dates that are not worked, beside the days WorkingWeek leaves out.

Value
Only the date part of each is read. The default is an empty list of the board's own; setting null gives a new empty one.
Remarks

An ObservableCollection is watched. Give every view of a plan the same holidays.

IsReadOnly

public bool IsReadOnly

Gets or sets whether the reader can only look at the board and not move cards.

Value
The default is false.
Remarks

Cards can still be selected, activated and read, and MoveCard still moves them. Turning it on puts back a card being carried.

LaneBy

public BoardLaneBy LaneBy

Gets or sets what the board's rows, its lanes, stand for: nothing, the assignee, the category, or the phase – the top-level summary a task sits in.

Value
The default is BoardLaneBy.None: one lane, so the board is just columns.
Remarks

There is a lane for each value the tasks have, and a last one, labelled Unassigned, Uncategorised or No phase, for tasks without. Phases are in plan order; other lanes in the order their values first appear.

A card moved to another lane takes that lane's value: its ProjectTask.Assignee or ProjectTask.Category, or by phase its ProjectTask.ParentId, which becomes the phase's id – so a task nested deeper in the phase is moved to its top level. Into the lane for tasks without a value, the field is set to null. Changing it puts back a card being carried.

OverLimitBrush

public Brush OverLimitBrush

Gets or sets the colour of a column's count, and a bar under its heading, while it holds more cards than its BoardColumn.Limit; and of the outline of a carried card over a column that would refuse it.

Value
The default is a deep orange, #D9480F. null uses the system's hot-track colour.
Remarks

In Windows high contrast the system colours are used instead.

See also

ProgressBrush

public Brush ProgressBrush

Gets or sets the fill of the progress strip along the foot of a card, which fills from the leading edge with the task's ProjectTask.Progress.

Value
The default is a calm blue, #3B7DD8. null uses the system highlight colour.
Remarks

In Windows high contrast the system colours are used instead.

ProjectStart

public DateTime? ProjectStart

Gets or sets the first day work on the plan can happen, from which the cards' finish dates are worked out.

Value
The first possible day, or null to start at the earliest planned date among the tasks, or today when none has one. The default is null.

Schedule

public ProjectSchedule Schedule

Gets the plan as scheduled: every task's dates and float, the critical path, and what in the input could not be used.

Value
The current schedule; never null.
Remarks

The plan is scheduled again first when anything has changed. A board that is not loaded schedules afresh each time this is read.

SelectedTask

public ProjectTask SelectedTask

Gets or sets the selected task: the outlined card, which the arrow keys move from and Space picks up.

Value
A task that is a card on the board, or null for none; the default. It binds two-way by default.
Remarks

Setting a summary, or a task not in Tasks, outlines no card, and the property is cleared the next time the plan is scheduled. When the list is replaced, the selection moves to the task that now has the selected task's id, if there is one. Selecting does not scroll; call ScrollToTask for that.

SelectionBrush

public Brush SelectionBrush

Gets or sets the outline of the selected card and of a card being carried, and the mark showing where a carried card would land.

Value
The default is null: the system highlight colour.
Remarks

In Windows high contrast the system colours are used instead.

ShowCriticalPath

public bool ShowCriticalPath

Gets or sets whether each card on the critical path has a stripe in CriticalBrush down its leading edge.

Value
The default is true.
Remarks

A critical task is one with no float: a day lost on it is a day lost on the whole plan.

StrictLimits

public bool StrictLimits

Gets or sets whether a column's work-in-progress limit is enforced, refusing a card to a column that is already full.

Value
true to refuse; false, the default, to let a column go over its limit and say so in its heading, in OverLimitBrush.
Remarks

A column is full when it holds BoardColumn.Limit cards, counted across every lane; a column with no limit is never full, and reordering within a column is always allowed. A refused drop leaves the card where it was, without raising CardMoving, and applies to MoveCard too. A card carried over a full column shows that it would be refused.

Tasks

public IList<ProjectTask> Tasks

Gets or sets the tasks of the plan: a flat list in outline order, in which a subtask names its summary through ProjectTask.ParentId.

Value
The tasks to show. The default is an empty list of the board's own; setting null gives a new empty list, so it is never null.
Remarks

Every task with no subtasks is a card; summaries are not. While the board is loaded, an ObservableCollection or a BindingList<T> is watched, and so is every task in it, so a status changed anywhere moves the card. A plain List<T> is read when assigned; call Reschedule after changing one. Assigning a new list puts back a card being carried.

Example
board.Tasks.Add(new ProjectTask("bug-212", "Basket total rounds wrongly", 1)
{
    Status = "Backlog",
    Assignee = "Ana Ruiz",
    Category = "Defect",
});

Today

public DateTime? Today

Gets or sets the date the charts treat as today. A board has no timeline and draws nothing for it.

Value
The default is null, the computer's date.
Remarks

It is here so that the same settings can be given to a GanttChart, which draws its today line there, a PertChart and a board alike.

VisualChildrenCount

protected override int VisualChildrenCount

Gets the number of child elements: the vertical and the horizontal scroll bar. Everything else is drawn.

Value
Always 2.

WorkingWeek

public WorkingWeek WorkingWeek

Gets or sets the days of the week on which work happens.

Value
The default is WorkingWeek.Weekdays, Monday to Friday; WorkingWeek.None is read as every day.

Methods

ArrangeOverride

protected override Size ArrangeOverride(Size arrangeBounds)

Places the scroll bars, which appear only when the board is larger than its view, and carries out a scroll asked for before the board had a size.

Parameters
arrangeBounds
The size the board has been given.
Returns

arrangeBounds: the board uses all of it.

GetEnumerator

protected override IEnumerator LogicalChildren

Gets the two scroll bars, as logical children, so that they take the board's resources and styles.

Value
An enumerator over the vertical and the horizontal scroll bar.

GetVisualChild

protected override Visual GetVisualChild(int index)

Returns one of the two scroll bars.

Parameters
index
0 for the vertical scroll bar, 1 for the horizontal one.
Returns

The scroll bar.

Exceptions
ArgumentOutOfRangeException
index is not 0 or 1.

MeasureOverride

protected override Size MeasureOverride(Size constraint)

Asks for the whole board's size – every column, and every lane with its cards – or for the room available when that is less.

Parameters
constraint
The room available, in logical units; either side may be infinite.
Returns

The size wanted.

MoveCard

public bool MoveCard(ProjectTask task, string status, string lane, int index)

Moves a task's card, exactly as the reader would: CardMoving is raised first and can cancel it, StrictLimits applies, and CardMoved follows.

Parameters
task
The task whose card moves. It must be a card on the board: not a summary, and in Tasks.
status
The column to move it to: the BoardColumn.Status of one of the board's columns.
lane
The lane: the value of the LaneBy field, empty for the lane of tasks without one, or null to keep its lane. A value no lane has yet is written to the task as it is, which makes a new lane; by phase it should be the id of a top-level summary. Ignored when LaneBy is BoardLaneBy.None.
index
Its position among the cards in that column and lane, from 0. A negative number, or one past the end, puts it last.
Returns

true when the card moved; false when the task is not a card, the column does not exist, the card is already there, the column is full under StrictLimits, or a handler cancelled the move.

Remarks

The move is reported with TaskEditSource.Application as its source, and works whether or not IsReadOnly is set.

Example
// Hand the orders API to Sam and put it at the top of his In progress cards.
bool moved = board.MoveCard(apiTask, "Doing", "Sam Okafor", 0);

OnCreateAutomationPeer

protected override AutomationPeer OnCreateAutomationPeer()

Gives UI Automation the board as a list of column headings and cards, so that a screen reader can read the board and follow a card being moved.

Returns

The board's automation peer.

Remarks

A heading is named with its column, its count and its limit; a card with its task, column and lane, and it can be selected, scrolled into view and invoked, which raises TaskActivated. Picking a card up, carrying it and dropping it are announced through a live region.

OnDpiChanged

protected override void OnDpiChanged(DpiScale oldDpi, DpiScale newDpi)

Redraws for a new display scale, so that text is measured for the pixels it lands on.

Parameters
oldDpi
The scale before.
newDpi
The scale now.

OnGotKeyboardFocus

protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)

Shows the focus cue and tells a screen reader which card is current.

Parameters
e
The event data.

OnKeyDown

protected override void OnKeyDown(KeyEventArgs e)

Carries out the board's keys. With no card carried: the arrows, Home and End move between cards, Space picks the current card up, Enter activates it, and Page Up and Page Down scroll. While a card is carried: the arrows carry it, Space or Enter drops it, and Esc puts it back.

Parameters
e
The key. Every arrow is marked handled, even at the edge of the board, so it never moves the focus out of the board.
Remarks

Up and Down run through a column and on into the next lane; Left and Right go to the neighbouring column, in the same lane where it has cards; Home and End go to the first and last card of the column. A carried card moves one place within its cell with Up and Down, one column with Left and Right, and one lane with Shift and Up or Down. With FrameworkElement.FlowDirection right to left, Left and Right swap. Space does nothing while IsReadOnly is set.

OnLostKeyboardFocus

protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)

Puts back a card carried from the keyboard when the board loses the focus, since the reader can no longer see or steer where it would go.

Parameters
e
The event data.

OnLostMouseCapture

protected override void OnLostMouseCapture(MouseEventArgs e)

Ends a drag without a move when something else takes the mouse – a window coming to the front, or the application capturing it.

Parameters
e
The event data.

OnMouseLeave

protected override void OnMouseLeave(MouseEventArgs e)

Hides the tooltip when the pointer leaves the board.

Parameters
e
The event data.

OnMouseLeftButtonDown

protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)

Selects the card under the pointer, raising TaskActivated on a double-click; a drag can follow. A press while a card is carried from the keyboard puts that card back.

Parameters
e
The press.

OnMouseLeftButtonUp

protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)

Drops a dragged card where the pointer is, through CardMoving. A press that never became a drag was just a click.

Parameters
e
The release.

OnMouseMove

protected override void OnMouseMove(MouseEventArgs e)

Picks a pressed card up once the pointer has moved the system's drag distance, then carries it, scrolling at the edge of the view; otherwise shows, after the hover time, a tooltip describing the card under the pointer.

Parameters
e
The move.

OnMouseWheel

protected override void OnMouseWheel(MouseWheelEventArgs e)

Scrolls up and down, 48 logical units a notch; with Shift, scrolls sideways.

Parameters
e
The wheel turn.

OnPropertyChanged

protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)

Redraws when a setting the drawing reads from the control itself changes: the font, Foreground, Background, FrameworkElement.Language, FrameworkElement.FlowDirection or the text formatting mode.

Parameters
e
The property that changed, with its old and new values.
Remarks

An override should call the base implementation.

OnQueryCursor

protected override void OnQueryCursor(QueryCursorEventArgs e)

Shows a hand over a card that can be moved and while one is dragged, and the "not allowed" cursor over a place that would refuse the card.

Parameters
e
The event data.

OnRender

protected override void OnRender(DrawingContext drawingContext)

Draws the board: the column headings, fixed above the scrolling lanes and cards, then a dragged card's copy over both.

Parameters
drawingContext
Where to draw.

Reschedule

public void Reschedule()

Schedules the plan again now and lays the board out again.

Remarks

Needed only after changing a plain List<T> or array, or a task in one, or a BoardColumn's properties; observable collections and the objects in them are watched. ScheduleChanged is raised before this returns.

ScrollToTask

public void ScrollToTask(ProjectTask task)

Scrolls the board, as little as it needs to, so that a task's card is in view below the column headings.

Parameters
task
The task to show. Nothing happens for null, a summary, or a task that is not on the board.
Remarks

The selection does not change; set SelectedTask as well to outline the card. Called before the board has a size, it waits for the first layout.

Events

CardMoved

public event EventHandler<TaskEventArgs> CardMoved

Occurs after a card has moved and its task's fields have been changed.

Remarks

The task already carries its new ProjectTask.Status, lane field and ProjectTask.Rank; other cards in the cell it landed in may have new ranks too. Save the tasks here to keep the move. The plan is scheduled again afterwards, once.

See also

CardMoving

public event EventHandler<CardMovingEventArgs> CardMoving

Occurs when a card is about to move – dropped by the pointer or the keyboard, or moved by MoveCard – before anything has changed. Cancel it to keep the card where it is.

Remarks

The event data names the task, how the move was made, and where the card is and would go: its column (CardMovingEventArgs.FromStatus, CardMovingEventArgs.ToStatus), its lane and its position. A drop where the card already is, or one StrictLimits refuses, is not offered.

When nobody cancels, the board sets the task's ProjectTask.Status, its lane field and its ProjectTask.Rank, re-numbers the other cards in the cell it lands in, and raises CardMoved. This is the one place for rules of your own, such as "only finished work goes to review", whichever way the card was moved; a reader who used the keyboard hears that the move was not allowed.

Example
board.CardMoving += (sender, e) =>
{
    if (e.FromStatus == "Done" && e.Source != TaskEditSource.Application)
        e.Cancel = true;                    // finished work is not reopened from the board
};
See also

ScheduleChanged

public event EventHandler ScheduleChanged

Occurs after the plan has been scheduled again because something changed: a task, a link, one of the lists, or a scheduling setting.

Remarks

Changes arriving together – a card move re-ranking a whole column – are scheduled once and announced once, from the dispatcher, after they have all arrived. Reschedule raises it before it returns. A board that is not loaded does not raise it; nor does loading one, so read Schedule when the board is loaded if you need the first result.

SelectedTaskChanged

public event EventHandler SelectedTaskChanged

Occurs when SelectedTask changes: the reader chose another card, the application set the property, or the selected task left the board.

TaskActivated

public event EventHandler<TaskEventArgs> TaskActivated

Occurs when the reader asks to open a task: by double-clicking its card, or by pressing Enter on the current card when none is being carried.

Remarks

The board does nothing else with it; it is the place to open the task's details. The card is already selected.

Fields

BadgeBrushProperty static

public static readonly DependencyProperty BadgeBrushProperty

Identifies the BadgeBrush dependency property.

CardBackgroundBrushProperty static

public static readonly DependencyProperty CardBackgroundBrushProperty

Identifies the CardBackgroundBrush dependency property.

CardBorderBrushProperty static

public static readonly DependencyProperty CardBorderBrushProperty

Identifies the CardBorderBrush dependency property.

CardHeightProperty static

public static readonly DependencyProperty CardHeightProperty

Identifies the CardHeight dependency property.

ColumnBackgroundBrushProperty static

public static readonly DependencyProperty ColumnBackgroundBrushProperty

Identifies the ColumnBackgroundBrush dependency property.

ColumnWidthProperty static

public static readonly DependencyProperty ColumnWidthProperty

Identifies the ColumnWidth dependency property.

ColumnsProperty static

public static readonly DependencyProperty ColumnsProperty

Identifies the Columns dependency property.

CriticalBrushProperty static

public static readonly DependencyProperty CriticalBrushProperty

Identifies the CriticalBrush dependency property.

HolidaysProperty static

public static readonly DependencyProperty HolidaysProperty

Identifies the Holidays dependency property.

IsReadOnlyProperty static

public static readonly DependencyProperty IsReadOnlyProperty

Identifies the IsReadOnly dependency property.

LaneByProperty static

public static readonly DependencyProperty LaneByProperty

Identifies the LaneBy dependency property.

LinksProperty static

public static readonly DependencyProperty LinksProperty

Identifies the Links dependency property.

OverLimitBrushProperty static

public static readonly DependencyProperty OverLimitBrushProperty

Identifies the OverLimitBrush dependency property.

ProgressBrushProperty static

public static readonly DependencyProperty ProgressBrushProperty

Identifies the ProgressBrush dependency property.

ProjectStartProperty static

public static readonly DependencyProperty ProjectStartProperty

Identifies the ProjectStart dependency property.

SelectedTaskProperty static

public static readonly DependencyProperty SelectedTaskProperty

Identifies the SelectedTask dependency property.

SelectionBrushProperty static

public static readonly DependencyProperty SelectionBrushProperty

Identifies the SelectionBrush dependency property.

ShowCriticalPathProperty static

public static readonly DependencyProperty ShowCriticalPathProperty

Identifies the ShowCriticalPath dependency property.

StrictLimitsProperty static

public static readonly DependencyProperty StrictLimitsProperty

Identifies the StrictLimits dependency property.

TasksProperty static

public static readonly DependencyProperty TasksProperty

Identifies the Tasks dependency property.

TodayProperty static

public static readonly DependencyProperty TodayProperty

Identifies the Today dependency property.

WorkingWeekProperty static

public static readonly DependencyProperty WorkingWeekProperty

Identifies the WorkingWeek dependency property.