VS Xaml constructor error

I have an error with my Xaml files in a WPF application. I can not see my control in the designer of Visual Studio or in Blend. But the application compiles and works fine.

Blend says that there is invalid Xaml there, and the error just doesn't cause any feeling, but when I close the control, there is no more error.

In Visual Studio, the error is more pronounced.

Error 27 Invalid XmlnsDeclaration occurs in assembly 'Microsoft.Expression.Interactivity, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. XmlnsDeclaration references a namespace 'Microsoft.Expression.Interactivity.Layout' that is not in the assembly. 

I did my research on this error, and I found interesting things.

Solution 1

Create a dummy class with the Microsoft.Expression.Interactivity.Layout namespace.

Result? Does not work.

Solution 2 Use ...

 xmlns:i="clr-namespace:Microsoft.Expression.Interactivity;assembly=Microsoft.Expression.Interactivity" 

Instead

 xmlns:i="http://schemas.microsoft.com/expression/2009/interactivity" 

... to add a link.

Result? I already did it like that.

UPDATE

I tried the link to the url of the schemes only in Blend and still did not work.

Error:

 "The specified value cannot be assigned to the collection. The following type was expected : "TriggerAction". 

With this code:

 <interactivity:Interaction.Triggers><interactivity:EventTrigger EventName="SelectionChanged" ><my:CommandAction Command="{Binding BreedingListSelectionChanged}" SyncOwnerIsEnabled="True" /></interactivity:EventTrigger></interactivity:Interaction.Triggers 

Finally, I found this post from a Microsoft-only support community guy. He said this is a known issue, and it will probably be a fix for the next release.

The fact is that I need it right now.

Has anyone encountered this issue?

Thanks.

+4
source share
1 answer

I logged a bug in Connect regarding this exact behavior.

Short answer: this will not be fixed for VS 2008, but it works in VS 2010. The best solution I found is to use Blend for user interface design (using expression syntax / 2009 / interactivity) and install Visual Studio to edit XAML as XML (not using the constructor). It worked out fine for me.

+3
source

All Articles