Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I am using MVVM pattern for my existing application - having a couple of projects (Silverlight 4 and MS VS 2010). Also I do have the Blend 4 in my system.

I was trying to explore and use the triggers between the View and the ViewModel, using the Expression.Samples.Interactivity.dll.

I added a reference to this assembly into my project, and also a line in the xaml page:

XML
xmlns:ei="clr-namespace:Expression.Samples.Interactivity;assembly=Expression.Samples.Interactivity"


There was no need for me to add a reference for System.Windows.Interactivity.dll, because it was already present in our application.

Later in the XAML code, I added the following lines:

XML
<l:EventTrigger>
    <ei:CallDataMethod>

    </ei:CallDataMethod>
</l:EventTrigger>


After adding these lines, I got the following error message:

Error 18 A value of type 'CallDataMethod' cannot be added to a collection or dictionary of type 'TriggerActionCollection'

I googled for this and didn't find the solution to this issue.

Please help me.

Thanks,
Sruthi
Posted
Updated 11-Jun-13 1:24am
v2

Hi,

After hours of research and exploring in Google, I came to know that the assembly "Expression.Samples.Interactivity.dll" no longer works with Silverlight 4, due to version issues. For Silverlight 4, it has been updated to "Microsoft.Expression.Interactions.dll". Even the property "CallDataMethod" was also updated to "CallMethodAction" property.

I removed the Expression.Samples.Interactivity.dll and added Microsoft.Expression.Interactions.dll as a reference. Also I updated the following code as:

xmlns:l="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"


After updating this, I was able to add the following code with out any issue. Also the Intellisense for the trigger is working properly.

<sdk:datagrid... >
.....
 <l:interaction.triggers>
   <l:eventtrigger eventname="LoadingRow">
       <ei:callmethodaction methodname="UpdateRowBackGroundColor"/>
   </l:eventtrigger> 
 </l:interaction.triggers>
<sdk:datagrid>
</sdk:datagrid></sdk:datagrid...>


Then, I built the solution and it was successful. When I debugged it, I ended up in another new runtime issue in one file (xxxx.xaml.g.i.cs):

{System.Windows.Markup.XamlParseException: The type 'CallMethodAction' was not found because 'clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions' is an unknown namespace. [Line: 1109 Position: 69]
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)}


Please help me!

Thanks,
Sruthi
 
Share this answer
 
v3
Comments
Sruthi Jain 14-Jun-13 6:15am    
Any suggestions for the above issue?
vingadordofuturo 25-Nov-13 20:59pm    
u can get the the source code to the method "CallDataMethod" from codeplex just go to:
http://expressionblend.codeplex.com/SourceControl/latest#Common/Interactivity/CallDataMethod.cs and add on your projec
I'm also stuck up in same situation. I'm getting same error. Please help
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900