wpf VisualState与wpfToolkit冲突?

pro*_*nis 4 wpf expression-blend

我正在使用wpfToolkit 3.5作为引用程序集在VS2010中构建应用程序.

我试图从ExpressionBlend 4添加一些VisualStates,当我尝试构建项目时,我收到以下错误.

类型'System.Windows.VisualState'存在于'c:\ Program Files(x86)\ Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\PresentationFramework.dll'和'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>
Run Code Online (Sandbox Code Playgroud)

我也试过了,但发生了同样的错误

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>
Run Code Online (Sandbox Code Playgroud)

有什么建议?

谢谢

小智 11

这是外部别名http://msdn.microsoft.com/en-us/library/ms173212.aspx

你可以通过Visual Studio来设置它

  1. 右键单击WPFToolkit引用以查看其属性,
  2. 将"别名"字段更改为您喜欢的任何内容.