Quantcast
Viewing latest article 8
Browse Latest Browse All 25

Lifecycle of a WorkItem

An important facet of programming with the Composite UI Application Block is understanding the sequence of events that fire during the lifetime of a WorkItem. For example, in the Activate event for your WorkItem you may want to enable some toolbar or menu items and then show a view.

WorkItem events fall into 3 categories. The startup event is RunStarted. The operating events are Activating, Activated, Deactivating and Deactivated. The shutdown events are Terminating and Terminated. These events follow the standard .NET conventions. For example, Activating fires before Activated and is cancelable.

RunStarted fires during the Run method. Activating fires before the WorkItem status changes to Active - Activated fires after. Deactivating fires before the WorkItem status changes to Inactive - Deactivated fires after the status change. Terminating fires before the WorkItem status changes to Terminated - Terminated fires after.

These WorkItem events are the foundation of WorkItemExtensions.

Image may be NSFW.
Clik here to view.

Viewing latest article 8
Browse Latest Browse All 25

Trending Articles