gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 14:10:51 25 4
gpt4 key购买 nike

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

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com