首页 文章

如何使Extended WPF Toolkit ColorPicker工作?

提问于
浏览
9

我希望能够在我的应用程序中使用此颜色选择器:

http://wpftoolkit.codeplex.com/wikipage?title=ColorPicker&referringTitle=Documentation

我正在使用安装了.NET 4的Visual Studio 2010 Ultimate . 我在C#和WPF(XAML)编码 .

到目前为止我做了什么:

  • 已下载并解压缩的WPFToolkit.Extended.dll

  • 在Visual Studio中添加了对它的引用(我能以某种方式验证它吗?)

  • 将此行添加到MainWindow.xaml.cs:使用Xceed.Wpf.Toolkit;

  • 在MainWindow.xaml中添加了粗线:

<Window x:Class = "TDDD49Task2.ColorWindow" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit/" [...]>

  • 试图在MainWindow.xaml中使用<xctk:ColorPicker>(错误消息:“找不到类型'xctk:ColorPicker' . 确认您没有错过程序集引用,并且已经构建了所有引用的程序集 . ”) .

  • 用Google搜索解决方案,教程或示例但没有取得多大成功 .

请解释如何使用Extended WPF Toolkit或指向正确的方向 .

2 回答

  • 20

    它虽然为我工作,但你包括的 namespace 是不正确的 . Remove the last backslash at the end . 它应该是 -

    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    

    代替

    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit/"
    
  • 8

    当您不取消阻止程序集时也会发生此错误 .

    以下是对此的简短说明:

    • 右键单击"WPFToolkit.Extended.dll" .

    • 单击“安全性”部分中的“取消阻止” .

    enter image description here

相关问题