wpf VisualState与wpfToolkit冲突? [英] wpf VisualState conflicts with wpfToolkit?
问题描述
我正在使用wpfToolkit 3.5作为参考程序集在VS2010中构建应用程序.
I am building an application in VS2010 with wpfToolkit 3.5 as referenced assembly.
我试图从ExpressionBlend 4中添加一些VisualState,但是在尝试构建项目时出现以下错误.
I tried to add some VisualStates from ExpressionBlend 4 and I am getting the following error when I am trying to build the project.
类型'System.Windows.VisualState' 在两个'c:\ Program文件中都存在 (x86)\参考 程序集\ Microsoft \ Framework.NETFramework \ v4.0 \ PresentationFramework.dll' 和'c:\ Program Files(x86)\ WPF 工具包\ v3.5.50211.1 \ WPFToolkit.dll'
The type 'System.Windows.VisualState' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\PresentationFramework.dll' and 'c:\Program Files (x86)\WPF Toolkit\v3.5.50211.1\WPFToolkit.dll'
这是代码
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ShowHideRoomNumber">
<VisualState x:Name="Show"/>
<VisualState x:Name="Hide">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="comboBox">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
我也尝试过,但是发生了相同的错误
I tried also and this but the same error occured
xmlns:vsm="clr-namespace:System.Windows;assembly=WPFToolkit"
<vsm:VisualStateManager.VisualStateGroups>
<vsm:VisualStateGroup x:Name="ShowHideRoomNumber">
<vsm:VisualState x:Name="Show"/>
<vsm:VisualState x:Name="Hide">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="comboBox">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</vsm:VisualState>
</vsm:VisualStateGroup>
</vsm:VisualStateManager.VisualStateGroups>
有什么建议吗?
谢谢
推荐答案
这是 extern别名的用途 http://msdn.microsoft.com/en-us/library/ms173212.aspx
您可以通过
- 右键单击WPFToolkit参考以查看其属性,
- 将别名"字段更改为您喜欢的任何内容.
这篇关于wpf VisualState与wpfToolkit冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!