15

我添加到引用 WPFToolkit.dll 并添加了我的 .xaml 文件以下行:

xmlns:toolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WpfToolkit"

在以下行之前:

xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"

在这两种情况下

<toolkit:NumericUpDown Value="10" Increment="1" Maximum="10" Minimum="0" />

我有错误:

错误 1 ​​XML 命名空间“http://schemas.microsoft.com/wpf/2008/toolkit”中不存在标记“NumericUpDown”。第 20 行位置 18. C:\Users\Diament\Documents\Visual Studio 2008\Projects\MyBasicFlyffKeystroke\MyBasicFlyffKeystroke\Window.xaml 20 18 MyBasicFlyffKeystroke

问题出在哪里?:(

4

7 回答 7

9

我有同样的问题。

如果我跳过取消阻止步骤并简单地解压缩,则不会加载 xaml 预览窗口,并且 VS 会不断给我“IntegerUpDown 组件在命名空间http://schemas.xceed.com/wpf/xaml/toolkit中不存在”错误,即使自动完成功能会愉快地列出该命名空间中的所有组件。

但是,如果我先解压缩zip文件,然后解压缩,然后在 VS 中引用 dll,则一切正常。

TL;DR:完全按照安装说明 进行操作,尤其是首先解除对 zip 文件的阻止。

于 2015-12-09T11:05:08.217 回答
5

NumericUpDown 不是基本 WPF 工具包的一部分,而是扩展 WPF 工具包的一部分

使用 IntegerUpDown(或任何提供的派生类)并确保在您的应用程序中使用适当的 DLL。以下是在您的项目引用扩展 WPF 工具包 DLL ( Xceed.Wpf.Toolkit.Dll ) 时使用 IntegerUpDown 的示例:

<Window x:Class="WpfApplication4.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="Window1" Height="300" Width="300">
    <Grid>
      <toolkit:IntegerUpDown Value="10" Increment="1" Minimum="0" Maximum="10" />
   </Grid>
</Window>
于 2013-02-20T17:38:23.077 回答
2

尝试

xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
于 2012-07-02T22:55:53.777 回答
2

我发现了同样的错误。您必须卸载当前的安装工具包并重新安装工具包,它将解决错误。它不是正确的解决方案,但您可以继续工作。

于 2017-04-25T06:28:45.157 回答
2

http://wpftoolkit.codeplex.com/documentation

安装使用说明

请注意:扩展的 WPF 工具包依赖于 .NET Framework 4.0。您必须安装 .NET Framework 4.0 才能使用 Toolkit 中的任何功能。

使用扩展 WPF 工具包二进制文件的说明:

1.Install .NET Framework 4.0. 
2.Download the ExtendedWPFToolkit_Binaries 
3.Unblock the ZIP file. 1.Right-click ExtendedWPFToolkit_Binaries.zip -> Properties -> Unblock 

4.Unzip the ExtendedWPFToolkit_Binaries.zip 
5.Reference the binaries in your project: 
    1.Reference WPFToolkit.Extended.dll in your project (Xceed.Wpf.DataGrid.dll for the datagrid control) 
    2.Add a using statement ("using Xceed.Wpf.Toolkit;" for most of the controls, "using Xceed.Wpf.DataGrid;" for the datagrid control) to the top of .cs files 
    3.Add a new xmlns (xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" for most of the controls, xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid" for the datagrid control) to the top of XAML files 
    4.Remember to use the namespace prefix (in the above example, <xctk: ...> or <xcdg: ...>) in the body of your XAML 

使用 NuGet 安装

1.Install NuGet (can be downloaded for  this link: https://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c). 
2.Open your Visual Studio. 
3.Open your solution/project. 
4.Open Tools menu, select Library Package Manager and select  Package Manager Console 
5.Run the following command Install-Package Extended.Wpf.Toolkit 
    1.Add a using statement ("using Xceed.Wpf.Toolkit;" for most of the controls, "using Xceed.Wpf.DataGrid;" for the datagrid control) to the top of .cs files

    2.Add a new xmlns (xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" for most of the controls, xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid" for the datagrid control) to the top of XAML files 
    3.Remember to use the namespace prefix (in the above example, <xctk: ...> or <xcdg: ...>) in the body of your XAML 
于 2016-10-14T20:11:18.203 回答
2

我遵循了@Andrew 的建议(下载、取消阻止、提取、添加),但仍然遇到同样的问题。

相反,通过 NUGET 安装(按照此处页面上的说明进行操作)使其无需执行手动步骤即可工作。

去努吉特...

于 2016-04-23T08:38:01.717 回答
0

注意:考虑Extended WPF Toolkit - Numeric Up Down已过时。他们强烈建议使用任何“专业”版本。顺便说一句,这不应该生成Error,而是Warning

找不到程序集怎么办,请检查您的项目和Wpf Toolkit版本的兼容性。

于 2012-07-02T17:40:41.143 回答