开发者

VS Xaml designer error

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜