Geeks With Blogs

News

View Anthony Trudeau's profile on LinkedIn

Add to Technorati Favorites


Anthony Trudeau

I ran into an issue on Friday night while using the Infragistics controls within the scope of the Composite UI Application Block (CAB).  My problem started when I tried to create a command with CAB from a UltraToolbarsManager tool using a function with a CommandHandler attribute that matched the signature of the event as shown below:

 

   // statement within the work item
   Commands["MyCommand"].AddInvoker(myTool, "ToolClick");

  

   [CommandHandler("MyCommand")]

   public void MyCommand(object sender, ToolClickEventArgs e)

   {

      // do something

   }

 

The application compiles fine; however, at run-time you get an ArgumentException as soon as the class with the CommandHandler is added to the WorkItem.  The message on the exception is "Error binding to target method."  Internally, the CAB fails at CommandStrategy.CreateCommandHandler method.

After a little digging I determined that the EventArgs sub-classes such as ToolClickEventArgs are not serializable as is standard fare for EventArgs classes and that is apparently required by CAB.  Typically in the case of a toolbar button click it will not matter, because all you care is what button was pushed.  But, with the Infragistics UltraWinToolbars you can have different buttons such as a state button or a combo box button.  In those cases you likely will need access to the state of the tool.

I opened up a support incident with Infragistics and this morning I was told that a feature request has been made.  The feature request is FR11622 if you run into this same problem and want them to change it.  At this point the request hasn't been committed to development, so please let them know if you need this too.

You can work-around this problem by changing the ToolClickEventArgs to EventArgs in your CommandHandler attributed method, but then you have to figure out a different way to get at the button state.

Posted on Wednesday, July 22, 2009 9:50 AM Infragistics , .NET | Back to top


Comments on this post: FR11622: Serializable EventArgs for Infragistics Controls

# re: FR11622: Serializable EventArgs for Infragistics Controls
Requesting Gravatar...
Anthony,

Consider this committed to development for review. You should get an update from our DS department shortly. Thanks for the feedback.

Cheers,

Andrew M. Flick
Product Manager :: Infragistics
Left by Andrew M. Flick on Aug 24, 2009 4:25 PM

# re: FR11622: Serializable EventArgs for Infragistics Controls
Requesting Gravatar...
Thank you for committing this to development for review.
Left by Anthony Trudeau on Aug 24, 2009 4:54 PM

# re: FR11622: Serializable EventArgs for Infragistics Controls
Requesting Gravatar...
I just received notification that this will be fixed in the next service release.
Left by Anthony Trudeau on Aug 26, 2009 8:49 AM

Your comment:
 (will show your gravatar)


Copyright © Anthony Trudeau | Powered by: GeeksWithBlogs.net