Command Handler Parameters

Topics: CAB & Smart Client Software Factory
Oct 21, 2006 at 12:03 AM
originally posted by: surajguptha

Currently i am using the following code in the ModuleController class to add a CommandHandler for a Menu Item Click

WorkItem.Commandscommand.AddInvoker(item, "Click");

and i use the following to handle the command

CommandHandler("PlanningMenuClick")
public void PlanningMenuClickHandler(object sender, EventArgs e)
{ .................... }

I want to send some custom parameters to my handler. Any thought of how i can do it?

Thanks for your time
Oct 21, 2006 at 4:11 AM
originally posted by: matiaswoloski

Commands don't allow you to pass a payload. They are an abstraction for invoking UI elements like buttons, toolstripitems, etc.
You might want to have context information in some custom service or you can use the EventBroker and send custom EventArgs

This thread is a discussion regarding that and possible workarounds:
http://www.gotdotnet.com/codegallery/messageboard/thread.aspx?id=22f72167-af95-44ce-a6ca-f2eafbf2653c&mbid=5194517d-42c9-4cfd-b7a5-87d7cebc6c60&threadid=dfa38f94-9fc6-45de-bd40-b93b369ef1fb

Matias
http://staff.southworks.net/matiaswoloski