WorkItem.Activation What is it for exactly?

Topics: CAB & Smart Client Software Factory
Dec 2, 2006 at 10:59 AM
originally posted by: SkySigal2


I'm sort of getting there wow, steep road :-)
but I'm a little confused as to the WorkItem.Activate concept and would appreciate feedback/pointers as to its use.

What i think I understand so far is:
a) Shell has two workspaces in it.
b) module catalog mounts several Module (Contacts, Cal, Mail)
b) Each Module has ModuleInit
c) ModuleInit creates a WorkItem
d) each WorkItem is registered as a child of Root workItem
e) workItem.Run() creates a View, triggering creation of its Controller...
f) we workspace.Show(view);

Got that part (I think) so far...

So we have an Active View/SmartPart.

a) Now on to WorkItem... what does it mean to be Active?
b) What makes a WorkItem active? (the last Shown view causes WorkItem to be active?)
c) What do I use/reference this flag for?
d) Does this affect State (which I've barely scratched as of yet).

Thanks for any and all pointers to help me figure this out...
Dec 2, 2006 at 12:27 PM
originally posted by: JKraft4PIT

Well you seem to be getting it fairly well.

I have a workitem that hosts a bunch of views, commands, ect...

A) When this workitem becomes "Active" is when one if its smart parts become active. Has focus.

b) Refere to A

c) I am not sure what you would use it for. But I use it to show/hide/activate/deactivate all the toolbars, menus and commands that my workitem uses. Like in MS word when different documents (workitems) gain focus differnet toolbars and options are activated/shown/removed.

d) Not sure, anyone know? State is used when saving and loading workitems from the persistence service.

All this information I got was from the "BankTeller" quick start. In there it uses the workitem activate, and state persisntence in the Bankteller Workitem.


P.S. hope that helped.