Is Csla.InvokeMethod out, On the Way out, or still In

Is Csla.InvokeMethod out, On the Way out, or still In

Old forum URL:

Jav posted on Wednesday, September 01, 2010

I read in some posts that Csla.InvokeMethod is on Life Support, but I see it alive and kick'n in Csla 4.01

Can we have a status report on this.  Personally, I kinda like Csla.Invoke method, at least it is physically attached to a given button, TextBox etc.  After adding dozens and dozens of UI Controls to a page, the prospect of scattering an equal or more of these TriggerAction thingies just doesn't look too appealing.  And then you are scrolling up and down to find who does what and how!!

I would vote for keeping both - with equal rights please :)


RockfordLhotka replied on Wednesday, September 01, 2010

InvokeMethod is there for backward compatibility. I wouldn't remove something like that in a bug fix release like 4.0.x.

But the only really supported component is TriggerAction. You may consider the XAML awkward, but it works with the VS10 designer (the toolbox), and it is far more powerful and efficient than the InvokeMethod component.

InvokeMethod is really a hack. It is a set of related attached properties that all work together. There's no better way to describe this than that it is a hack - and that makes its internal implementation complex and prone to bugs. Basically, as each attached property is initialized, a new instance of InvokeMethod is created - and hopefully only the last instance that is created is the only one that ever actually gets used - but that's been a problem.

Additionally, VS10 has no designer support for attached properties, so InvokeMethod (and the Blend trigger action concept) forces you to type XAML by hand. In the long run I don't think manual typing of XAML is the way to go. I have confidence that designer tools will improve and typing XAML will become a relatively rare occurrence, so designer-friendly components are important.

Jav replied on Wednesday, September 01, 2010

Oh-Kay!  If that's the way it's gonna be.

Thanks Rocky.  I suspected there was a good reason for Invoke method to be shown the door.  It does make sense.  I am glad I asked the question before investing too much in it.  And thankyou for the definitive answer.


RockfordLhotka replied on Wednesday, September 01, 2010

If you really like InvokeMethod, I suggest you copy it out of CSLA into your project, then you can feel free to use it long-term.

Jav replied on Thursday, September 02, 2010

Naw!!  I'll go with you - it has always worked better for me.Yes

In fact I took up my most complex UI unit and have already changed over about 3/4 of all.  I found it easier to work with Xaml.  This way it's just a line of xaml immediately under the Xaml of UI control that it is handling and it doesn't even look much different from the Invoke method code. I copy and paste the line of Xaml, change the TargetControl and MethodName, and it is done.  Sometimes I have to change the TriggerEvent.   It's gonna work just fine.


Copyright (c) Marimer LLC