简体   繁体   中英

CallerMemberName to be used with INotifyPropertyChange for VB?

I'm trying to implement the CallerMemberName to be used with raising properties. I'm trying to do this in vb but can't find this interface in the system.runtime.compilerservices. First question is is this even possible for vb yet or is it just for c#? Thanks for help.

Public Sub RaisePropertyChanged(<CallerMemberName> Optional propertyName As String = Nothing)
    RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
End Sub

CallerMemberName really is CallerMemberNameAttribute in the System.Runtime.CompilerServices . It's definitely there as long as you're using .Net 4.5. And it works in VB.Net just fine, for me at least.

确保目标框架设置为 .NET 4.5

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM