This project is read-only.

Invoking viewmodel methods

Aug 31, 2010 at 4:17 AM

I'm working on a couple sample apps for Bxf, and I've encountered an issue.

When I actually use Bxf it is along with CSLA, which has a component called TriggerAction. TriggerAction takes any arbitrary UI event, and when that event occurs it invokes a method on the viewmodel (on the DataContext actually).

The Blend SDK has something similar, using trigger actions and a behavior that invokes a method on the DataContext.

But standard XAML only has commanding, which is pretty pathetic in comparison. It can't handle arbitrary UI events, and it requires much more complex code than TriggerAction or Blend trigger actions.

So now I'm wondering. Should my sample apps take a dependency on the Blend SDK so I can use trigger actions/behaviors. Or should I donate TriggerAction from CSLA to Bxf, so Bxf has its own answer to the problem. Or should I just live with commanding and ignore the issue.


Sep 13, 2010 at 12:42 AM

It sure would be nice if the solution could work with .NET 3.5 as well as 4.0 and earlier versions of CSLA than 4.0. Any chance that could be done? We still cannot move all code bases to 4.0 and would prefer solutions that work across the versions.


Sep 13, 2010 at 1:07 AM

There is a Visual Studio 2008 solution in the codebase, so if you grab the code you can build this for .NET 3.5.

Bxf has no connection to CSLA, so it should work reasonably well with older versions of CSLA. Of course CSLA 4 has better overall support for MVVM, but most of the important parts are in 3.8 too.

Sep 13, 2010 at 1:21 AM

Yes - I've got the solution running in 3.5 but was referring to the CSLA Trigger Action which I thought was 4.0 rather than 3.8 - assume if it is added to BXF it would work also under .NET 3.5. I've been playing with the Invoke method and Blend interactivity options in CSLA 3.8 so likely just a little confused with all the options.

Sep 13, 2010 at 1:58 AM

I did put TriggerAction into Bxf - let me know if you have trouble building/using it in 3.5, but I think it should work fine.

Sep 13, 2010 at 2:27 AM
Edited Sep 13, 2010 at 3:09 AM

In the Using Bxf sample as soon as you switch the project to 3.5 you  start getting build errors for "The tag 'TriggerAction' does not exist in XML namespace...". Is there some kind of simple fix for this?

I've found that in 4.0 if you remove the reference to System.Xaml the same issue arises so assuming it is tied into some reliance on that assembly.




This was my error - the BXF defaulted to build in .NET 4 and I incorrectly referenced that assembly.