Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 当对象的某个字段发生更改时,在整个对象上激发OnProperty更改_Wpf_Vb.net_Inotifypropertychanged - Fatal编程技术网

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("")