2010-04-16 31 views
1

這在.net framework 3.5客戶端下工作。簡單的Windows.Forms綁定失敗,使用框架4.0

這在.NET Framework 4.0客戶端下失敗。

我是否正在做一些在3.5以下是非法的東西,但碰巧工作,或者這是一個錯誤?

請注意,在我的項目'PropInt'中不會引發更改事件,因此 使用ctx [obj1.PropObj2,「PropInt」]不是選項。

public class Obj1 
{ 
    public Obj2 PropObj2 { get; set; } 

    public Obj1() 
    { 
     PropObj2 = new Obj2(); 
    } 
} 

public class Obj2 
{ 
    public int PropInt { get; set; } 
} 

static class Program 
{ 
    [STAThread] 
    static void Main() 
    { 
     var ctx = new BindingContext(); 
     var obj1 = new Obj1(); 
     var x1 = ctx[obj1, "PropObj2.PropInt"]; 
    } 
} 

回答

0

這看起來像是PropertyManager.GetItemProperties(PropertyDescriptor [] listAccessors)中的一個錯誤。