开发者

Binding dont refresh, even when explicitly calling UpdateTarget

开发者 https://www.devze.com 2023-01-02 22:54 出处:网络
My ListView does not refresh its bindings when i call OnPropertyChanged. I have tried to force it to refresh by:

My ListView does not refresh its bindings when i call OnPropertyChanged. I have tried to force it to refresh by:

NestedArguments.GetBindingExpression(ItemsControl.ItemsSourceProperty).UpdateTarget();

But still, no luck!

YES, it does get updated. I have set a breakp开发者_运维技巧oint and checked.

What is going on?

Other bindings seem to work without a problem


You are implement http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx interface?


is your onpropertychanged("") spelled correctly? its silly but it happens and if you arent checking for it you may miss it...

also how are you setting it? if it is a child property of a parent property you have to put the onpropertychanged notification for the child property in the parent property...

Public Property SelectedDoctorTaxonomy() As DoctorTaxonomy
            Get
                Return _objSelectedDoctorTaxonomy
            End Get
            Set(ByVal Value As DoctorTaxonomy)
                _objSelectedDoctorTaxonomy = Value
                OnPropertyChanged("SelectedDoctorTaxonomy")
                OnPropertyChanged("DoctorID")
                OnPropertyChanged("TaxonomySpecializationID")
                OnPropertyChanged("TaxonomyTypeID")
                OnPropertyChanged("TaxonomyClassificationID")
                OnPropertyChanged("AddDate")
                OnPropertyChanged("AddUserID")
                OnPropertyChanged("ChangeDate")
                OnPropertyChanged("ChangeUserID")
            End Set
        End Property

HTH

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号