WPF应用程序使用扩展WPF Toolkit Plus v2.1.0时出现错误

时间:2014-03-05 07:52:14

标签: wpf code-generation toolkit

我的WPF应用程序运行正常。但是,因为我尝试使用'MaskedTextBox'控件(Extended.Wpf.Toolkit.Plus.2.1.0),我得到以下构建错误:

«在命名空间“Microsoft.Windows”中找不到类型或命名空间名称“控件”(您是否缺少using指令或程序集引用?)»文件:'MasterMenu.g.cs'

Window声明(xaml)如下:

<Window x:Class="myProject.Presentation.MainModule.MasterMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:CustomControls;assembly=MyGroupBox"
    Title="myApplication-Démonstration"        
    WindowStartupLocation="CenterScreen" 
    WindowState="Maximized" 
    Loaded="Window_Loaded_1"
    Closed="Window_Closed">

源文件'MasterMenu.cs'中的'使用'指令是:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Winlease.CrossCutting.Logging;
using CustomControls;
using UITools;

生成的文件'MasterMenu.g.cs'中的使用是:

using CustomControls;
using Microsoft.Windows.Controls;
using Microsoft.Windows.Controls.Primitives;
using RootLibrary.WPF.Localization;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;

2行负责错误

using Microsoft.Windows.Controls;
using Microsoft.Windows.Controls.Primitives;

我删除了bin,obj目录,我多次清理解决方案并重建但错误仍然存​​在。

提前谢谢。

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。实际上我忘了在我的Prject中添加对WPFToolkit.dll的引用。就是这样。

谢谢。