开发者

Design Time Error - 'VisualState' occurs in at least two namespaces

I am getting the following error

Ambiguous type reference. A type named 'VisualState' occurs in at least two namespaces, 'System.Windows' and 'System.Windows'. Consider adjusting the assembly XmlnsDefinition attributes.

I am not referencing any of these assembly name spaces directly, I am doing the following:

开发者_如何学Go
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   

The application compiles fine, just throwing these errors at design time. This happens to a few other classes that are a part of the VSM library.


It sounds like you are trying to use the WpfToolkit compiled for WPF3.5 with WPF4. The VisualStateManager is now part of WPF4, so if you are using the toolkit for the DataGrid or VisualStateManager, you can simply remove the toolkit reference to resolve the ambiguity. If you want to use the toolkit for charting, then you should be using the WPF4 version of charting:

  • Silverlight/WPF Data Visualization Development Release 4

If you still need to use the old Toolkit with WPF4, you'll have to find all the XAML references to the VisualStateManager and related classes and prefix them with a namespace targeting the specific assembly that contains the System.Windows.VisualStateManager you want to use in order to resolve the ambiguity.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜