HypernovaDesktop Components · docs
Binarymission
WPF › Project Management › CardMovingEventArgs

CardMovingEventArgs

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

Provides data for the task board's TaskBoard.CardMoving event: a card about to move to another column, lane or position, which a handler can inspect and refuse.

public class CardMovingEventArgs : CancelEventArgs

Inherits from / implements: CancelEventArgs

Remarks

The task has not changed yet. Set CancelEventArgs.Cancel to true to refuse the move: the card goes back where it was and nothing is written. Otherwise the board sets the task's ProjectTask.Status to ToStatus, sets the field the lanes are split by to ToLane, and renumbers the ProjectTask.Rank of the cards in the cell it lands in.

Examples

board.CardMoving += (sender, e) =>
{
    // Only work that has been reviewed can be marked done.
    if (e.ToStatus == "Done" && e.FromStatus != "Review")
    {
        e.Cancel = true;
        statusText.Text = "\"" + e.Task.Name + "\" has to be reviewed first.";
    }
};

Members at a glance

Constructors
CardMovingEventArgsCreates the data for a proposed card move.
Properties
FromLaneGets the lane the card is in now.
FromStatusGets the status of the column the card is in now.
SourceGets how the move was made: TaskEditSource.Pointer, TaskEditSource.Keyboard or TaskEditSource.Application.
TaskGets the task whose card would move. It has not changed yet.
ToIndexGets the card's position in the cell (the column within the lane) it would go to.
ToLaneGets the lane the card would go to.
ToStatusGets the status of the column the card would go to: the task's new ProjectTask.Status.

Constructors

CardMovingEventArgs

public CardMovingEventArgs(ProjectTask task, TaskEditSource source, string fromStatus, string toStatus, string fromLane, string toLane, int toIndex)

Creates the data for a proposed card move.

Parameters
task
The task whose card would move.
source
How the move was made.
fromStatus
The status of the column the card is in.
toStatus
The status of the column it would go to.
fromLane
The lane it is in; empty for the lane of tasks without a value.
toLane
The lane it would go to; empty for the lane of tasks without a value.
toIndex
Its position in the cell it would go to, from 0.

Properties

FromLane

public string FromLane

Gets the lane the card is in now.

Value
An assignee, a category or a phase's task id, as the board's lanes are split; empty for the lane of tasks without a value, and for a board with no lanes.

FromStatus

public string FromStatus

Gets the status of the column the card is in now.

Value
A BoardColumn.Status. A task whose own status has no column is shown in the first column, and this is that column's status.

Source

public TaskEditSource Source

Task

public ProjectTask Task

Gets the task whose card would move. It has not changed yet.

ToIndex

public int ToIndex

Gets the card's position in the cell (the column within the lane) it would go to.

Value
From 0, the top of the cell.

ToLane

public string ToLane

Gets the lane the card would go to.

Value
As FromLane. When it differs from FromLane, the task's lane field is set to it, or to null for the lane of tasks without a value.

ToStatus

public string ToStatus

Gets the status of the column the card would go to: the task's new ProjectTask.Status.