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

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: