erothvt
erothvt

Reputation: 73

Blend preview for silverlight 5 throws error when using System.Windows.Interactivity

When viewing a Silverlight 5 project in blend if you are using System.Windows.Interactivity you get an error when loading the designer. Here is an example of the exception:

Unable to cast object of type 'Microsoft.Expression.Interactivity.Core.ChangePropertyAction' to type 'System.Windows.Interactivity.TriggerAction'.

The code compiles and runs with no issues I just cannot view the designer in blend. Has anyone else seen this issue?

Update: This may only be an issue in the themes\generic.xaml file.

Update: The fix was when declaring the namespaces in the xaml do this:

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"

instead of this:

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

Hopefully this will save someone else some time!

Upvotes: 2

Views: 1071

Answers (1)

erothvt
erothvt

Reputation: 73

The fix was when declaring the namespaces in the xaml do this:

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"

instead of this:

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

Hopefully this will save someone else some time!

Upvotes: 1

Related Questions