tags:

views:

184

answers:

1

Hi,

I have an error with my Xaml files in a WPF application. I'm not able to see my control in the Visual Studio designer or in Blend. But, the application compiles and is running perfectly.

In Blend, it says that there's an invalid Xaml and the error just make no sens at all, but when I close the control there's no more error.

In Visual Studio, the error is more explicit.

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 made my research on this error and I found some things interesting.

Solution 1

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

Result ? Not working.

Solution 2 Using...

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

Instead of

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

... to add my reference.

Result ? I was already doing it this way.

UPDATE

Tried the reference to the schemas url only in Blend and still not working.

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 by a guy from the Microsoft Only Community Support. He's saying that this it an known issue and it will probably be fix next release.

The fact is, I need it right now.

Anyone faced this problem ?

Thanks.

+2  A: 

I filed a bug on Connect regarding this exact behavior.

The short answer is that this will not be corrected for VS 2008, but it does work in VS 2010. The best solution I've found is to use Blend for UI design (using the expression/2009/interactivity syntax) and set Visual Studio to edit XAML as XML (not using the designer). This has worked quite well for me.

Reed Copsey
Thanks for the advice. For now, I'm not moving to Visual Studio 2010 before its official release. And it still doesn't work for Blend even with this syntax. See the update on my question post.
esylvestre
Yeah, Triggers have problems, even in Blend. You'll get that error with any behavior in VS, but most behaviors work fine in Blend. I've started making custom behaviors instead, just to avoid this error, which is really annoying. I'd recommend filing a short working sample on Connect to get Blend fixed, though.
Reed Copsey
Allright, thanks Reed.
esylvestre
Just tried on a VS 2010 beta 2 and still not working...
esylvestre
Hrm. Then I'd definitely make a small repo and post on connect.microsoft.com... That way, it'll get fixed (hopefully) before VS2010 RTM. They're responding very well to VS 2010 bugs right now.
Reed Copsey
Yep.It still confusing for me why my project doesn't work, but when I run this projet : http://sachabarber.net/?p=510 I have no problem at all...
esylvestre
Can you make a (very small) repo project? If so, post it here, and maybe on connect...
Reed Copsey