tags:

views:

79

answers:

2

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 breakpoint and checked.

What is going on?

Other bindings seem to work without a problem

A: 

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

Svisstack
I did not have that in my .xaml file, but adding it did not change. And i have implemented it in my view model.
Erik
A: 

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

ecathell
For smaller apps, you can also send an empty string to PropertyChanged, and it will walk the tree and refresh everything.
Robaticus
I have tried to send a empty string as well as null.
Erik