0

我收到如下所示的错误:

  Error 1   The tag 'ResourceDictionaryCollection' does not exist in XML
     namespace 'clr-namespace:System.Windows.Controls.DataVisualization;
    assembly=System.Windows.Controls.DataVisualization.Toolkit'.

这是代码:

             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
             mc:Ignorable="d" 
             MinHeight="384" MinWidth="579">
    <UserControl.Resources>
        <DV:ResourceDictionaryCollection x:Key="MyPalette">
            <ResourceDictionary>
                <Style x:Key="DataPointStyle" TargetType="Control">
                    <Setter Property="Background" Value="Purple" />
                </Style>
            </ResourceDictionary>

我应该如何纠正这个错误?我在 Visual C# 2010 上运行。我已经安装了 WPF 工具包,但我仍然收到命名空间错误。

4

1 回答 1

0

我通过用https://code.google.com/p/adsense-windows-gadget/中找到的 System.Windows.Controls.DataVisualization.Toolkit.dll 替换原始 System.Windows.Controls.DataVisualization.Toolkit.dll 找到了解决方案来源/结帐

估计是版本问题。。。

于 2013-05-16T18:17:21.303 回答