Wpf 当对象的某个字段发生更改时,在整个对象上激发OnProperty更改
让我们承认一段代码:Wpf 当对象的某个字段发生更改时,在整个对象上激发OnProperty更改,wpf,vb.net,inotifypropertychanged,Wpf,Vb.net,Inotifypropertychanged,让我们承认一段代码: [...] Private _filterContacts As FilterContacts Public Property FilterContacts() As FilterContacts Get Return _filterContacts End Get Set(ByVal value As FilterContacts) _filterCon
[...]
Private _filterContacts As FilterContacts
Public Property FilterContacts() As FilterContacts
Get
Return _filterContacts
End Get
Set(ByVal value As FilterContacts)
_filterContacts = value
OnPropertyChanged("FilterContacts")
End Set
End Property
Private _branchType As Nullable(Of Integer)
Public Property BranchType As Nullable(Of Integer)
Get
Return _branchType
End Get
Set(ByVal value As Nullable(Of Integer))
_branchType = value
OnPropertyChanged("BranchType")
End Set
End Property
[...]
Public Sub SomeSub()
FilterContacts.BranchType = BranchType
End Sub
我实际上更改了过滤器的“branchType”,但我希望得到通知,FilterContacts已经更改,而不仅仅是其中一个字段。可能吗?谢谢大家!
Set(ByVal value As Nullable(Of Integer))
_branchType = value
OnPropertyChanged("BranchType")
OnPropertyChanged("FilterContacts")
End Set
或者,如果要使对象上的所有属性无效,只需执行以下操作:
OnPropertyChanged("")