INotifyPropertyChanged有问题吗? [英] Problem with INotifyPropertyChanged ?

查看:94
本文介绍了INotifyPropertyChanged有问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在阅读INotifyPropertyChanged属性值时遇到问题。

这是我获取某些信息的方法

Hi,
I am facing the problem in reading the "INotifyPropertyChanged" property value.
This is my method to get some information

public string GetInformation()
{
   RequestObject request = new RequestObject();
   /*
          ...some code here to initialize request object...
       */
   ResponseObject response = service.GetInformation(request);
}



我的ResponseObject是


And my ResponseObject is

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");
            }
        }
 }



在调试时,响应对象包含Result属性,其中包含
$ b的列表$ b


At the time of debugging response object contains Result property that contains list of

ServiceObject // i.e. List<ServiceObject>



我想读取此列表的每个ServiceObject的值ImageCode。 ServiceObject类是


I want to read the value ImageCode of each ServiceObject of this list. And ServiceObject class is

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 ");
          }
      }
}





我不知道如何访问List< serviceobject>阅读,因为在编写代码时没有包含List< serviceobject>的任何属性,它在运行时出现。

请帮助我。如何访问List< serviceobject>



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>

推荐答案

这篇关于INotifyPropertyChanged有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆