This is a migrated thread and some comments may be shown as answers.

PropertyChanged always null in whole application

1 Answer 616 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 26 Jun 2012, 10:13 AM
Hello,
I've got a SL4 application I've been developing for almost 3 years... I've got a strange and weird problem.... all times I try to bind a class that implements INotifyPropertyChanged I got null on the event that should notify the change....

I've cross checked my code, copied the code from another working app... I don't know what's wrong

Here's my code

public partial class AnnullaQuestionarioUC : RadWindow, INotifyPropertyChanged
    {
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        public void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
 
private ObservableCollection<TipoAnnulloObj> listaTipoAnnullamento;
        public ObservableCollection<TipoAnnulloObj> ListaTipoAnnullamento
        {
            get
            {
                return listaTipoAnnullamento;
            }
            set
            {
                listaTipoAnnullamento = value;
                NotifyPropertyChanged("ListaTipoAnnullamento");
            }
        }
//[omitt]
}

Since it's happening in the entire application what can went wrong?

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 27 Jun 2012, 07:00 AM
Hi Paolo,

The implementation illustrated on the snippet seems to be right. I believe that the source of this issue does not lay there. Would you please check your code for some of the following cases: Binding to a CLR property, which is somewhere else modified through its private field. Or maybe you have a duplicate instance of AnnullaQuestionarioUC (i.e. having simultaneously a binding that uses a static resource instance of AnnullaQuestionarioUCas a Source and a DataContext for the same element with a value of AnnullaQuestionarioUC?). In case that you have not found anything particularly suspicious, feel free to send us a runnable project that isolates the issue, so that we would be able to debug it on our side.

Kind regards,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
General Discussions
Asked by
Michele
Top achievements
Rank 2
Answers by
Ivan Ivanov
Telerik team
Share this question
or