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

Jos*_*one 3 vb.net wpf converter ivalueconverter

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

XAML

xmlns:local="clr-namespace:ARC"
    <local:DoublerConvert x:Key="DoubleConverter"/> 'Doesn't work
    <local:ValueConverter x:Key="NegativeConverter"/> 'Works fine
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

小智 17

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