How do I get around this lambda expression outer variable issue?

后端 未结 4 1791
感情败类
感情败类 2021-01-19 18:47

I\'m playing with PropertyDescriptor and ICustomTypeDescriptor (still) trying to bind a WPF DataGrid to an object, for which the data is stored in a Dictionary.

Sinc

4条回答
  •  别那么骄傲
    2021-01-19 19:15

    create a local copy of s inside your for loop and use that.

    for(string s in this.Keys) {
    string key = s;
    //...
    }
    

提交回复
热议问题