Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am facing the problem in reading the "INotifyPropertyChanged" property value.
This is my method to get some information
C#
public string GetInformation()
{
   RequestObject request = new RequestObject();
   /*
          ...some code here to initialize request object...
       */
   ResponseObject response = service.GetInformation(request);
}

And my ResponseObject is
C#
public class ResponseObject:object, System.ComponentModel.INotifyPropertyChanged {
 {
    private ErrorObject errorField;

    public ErrorObject Error {
            get {
                return this.errorField;
            }
            set {
                this.errorField = value;
                this.RaisePropertyChanged("Error");
            }
        }

    public EntityResponse Results {
            get {
                return this.resultsField;
            }
            set {
                this.resultsField = value;
                this.RaisePropertyChanged("Results");
            }
        }
 }

At the time of debugging response object contains Result property that contains list of
C#
ServiceObject // i.e. List<ServiceObject>

I want to read the value ImageCode of each ServiceObject of this list. And ServiceObject class is
C#
public partial class ServiceObject : object, System.ComponentModel.INotifyPropertyChanged {
     private string imgCodeField;
     public string ImageCode {
          get {
              return this.imgCodeField;
          }
          set {
              this.imgCodeField = value;
              this.RaisePropertyChanged("ImageCode ");
          }
      }
}


I don't know how to access List<serviceobject> to read, because at the time writing code there is not any property that contains List<serviceobject>, It appears at run time.
Please help me. How can I access the values of List<serviceobject>
Posted
Updated 4-Aug-14 22:04pm
v2
Comments
Pheonyx 5-Aug-14 4:06am    
You need to make your list an observable collection else, the INotifyPropertyChanged event doesn't seem to bubble up. I've seen the issue before and I'm pretty sure that was the issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900