Commandhandlers not always called

Jul 26, 2007 at 3:11 AM
Hi there,

I have a number of WorkItems (LogonWorkItem, JobsWorkItem and DetailsWorkItem) that all are direct children of RootWorkItem. The each have corresponding Views and Presenters. The LogonView contains a button and in LogonPresenter.cs I have the following line:

rootWorkItem.Commands"uie://btnLogon".AddInvoker(view.LogonButton, "Click"); //Where _view is LogonView and _rootWorkItem is what it says

In my JobsWorkItem I have the following handler:

CommandHandler("uie://btnLogon")
public void OnLogonClick(object sender, EventArgs e)
{
RootWorkItem.Workspaces"mainTabWorkspace".Activate(_view);
}

which is called successfully whenever I tap the Logon button.

I inserted a similar handler in my LogonWorkItem (just to see what would happen):

//Doesn't get called. Why??????
CommandHandler("uie://btnLogon")
public void OnLogonClick(object sender, EventArgs e)
{
RootWorkItem.Workspaces"mainTabWorkspace".Activate(_view);
}

which as the comment says, is never called when I tap LogonButton.

I want to understand why this is not called. I am new to the MCSF so there is obviously something I don't understand about Commands and their handlers.

Could someone please explain it to me?

Many thanks...

Robert