Object of type 'Bxf.Xaml.ExecuteEventArgs' cannot be converted to type 'Csla.Xaml.ExecuteEventArgs'.

Object of type 'Bxf.Xaml.ExecuteEventArgs' cannot be converted to type 'Csla.Xaml.ExecuteEventArgs'.

Old forum URL: forums.lhotka.net/forums/t/10012.aspx


Ryan M posted on Tuesday, February 01, 2011

As far as I can tell I'm following the demo code from the MVVM videos very closely but when clicking save to create a new entry I get the subject error. 

This occurs in the BXF code in:

Bxf.Xaml.TriggerAction.CallMethod(object sender, EventArgs e)

 

while it's doing this:

targetMethod.Invoke(target, new object[] { this, new ExecuteEventArgs
{
 MethodParameter = parameterValue,
 TriggerParameter = e,
 TriggerSource = TargetControl
}});

Where ExecuteEventArgs is Bxf.Xaml.ExecuteEventArgs.

It is clear what's happening. 

However, because it's in either the BXF or CSLA source, so I'm not sure (1) how to fix the issue or (2) what additional information is needed to answer this question.

Any insights are appreciated.

Thanks,
Ryan

RockfordLhotka replied on Tuesday, February 01, 2011

You have to be careful which TriggerAction you use.

CSLA .NET has Csla.Xaml.TriggerAction, and Bxf has its own TriggerAction. And they each have their own ExecuteEventArgs type.

CSLA .NET also has Csla.Xaml.ViewModel, with public methods that rely on the CSLA TriggerAction.

You have to pick one or the other. If you want to use the Bxf TriggerAction, you need to create your own ViewModel<T> that inherits from ViewModelBase<T>, but accepts Bxf.Xaml.ExecuteEventArgs parameters.

I'd have done that in Bxf directly, but I don't want to couple Bxf to CSLA (or visa versa).

Copyright (c) Marimer LLC