wpf - 名称 "DoublerConvert"在命名空间 "clr-...."中不存在

标签 wpf vb.net converter ivalueconverter

我意识到还有其他具有相同标题的问题,但是我尝试了所有这些解决方案都无济于事。我正在尝试使用我制作的转换器。我的另一个转换器工作正常,这个新转换器是前一个转换器的复制粘贴,名称已更改,返回值已更改。

XAML

xmlns:local="clr-namespace:ARC"
    <local:DoublerConvert x:Key="DoubleConverter"/> 'Doesn't work
    <local:ValueConverter x:Key="NegativeConverter"/> 'Works fine

代码
Public Class ValueConverter
    Implements IValueConverter

    Public Function ProvideValue(serviceProvider As System.IServiceProvider) As Object
        Return Me
    End Function

    Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
        Dim OldWidth As Integer = value
        OldWidth = -OldWidth
        Return OldWidth
    End Function

    Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
        Throw New NotImplementedException
    End Function
End Class

Public Class DoublerConvert
    Implements IValueConverter

    Public Function ProvideValue(serviceProvider As System.IServiceProvider) As Object
        Return Me
    End Function

    Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.Convert
        Dim OldWidth As Integer = value
        Return 2 * OldWidth
    End Function

    Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As CultureInfo) As Object Implements IValueConverter.ConvertBack
        Throw New NotImplementedException
    End Function
End Class

最佳答案

您尝试杀死 XDesProc.exe 并重新加载您的 xaml。

关于wpf - 名称 "DoublerConvert"在命名空间 "clr-...."中不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13942856/

相关文章:

c# - 在 WPF 工具箱中找不到我的 winforms 控件

c# - 如何在 WPF 弹出窗口中放置 close [x]

excel - 在 SSIS 中运行脚本以修改 excel 文件时出现错误 :The server threw an exception.(来自 HRESULT 的异常:0x80010105 (RPC_E_SERVERFAULT))

从 vb 应用程序插入的 mysql (phpmyadmin) 行没有得到更新

java - 迁移到 tomcat 后,将枚举值作为参数从 JSF 页面传递给 bean 方法失败

wpf - 创建带有图像和文本的 wpf 按钮

c# - FileSystemWatcher 和 GUI

c# - 如何检测 .NET 中的不可打印字符?

streaming - 如何使用 `m4v` 将视频转换为 `ffmpeg` ?

java - XStream:如何在自定义转换器中编码/解码列表?