minton / binda

Simple Data Binding for WinForms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for flattening

opened this issue · comments

Given

public class Employee{
    public string Name { get; set; }
}

public class MyView{
    public Employee Who { get; set; }
}

public class MyObj{
    public string Who { get; set; }
}

I want to be able to

var view = new MyView{ Who = new Employee { Name = "Tom" } };
var obj = new MyObj();
binder.Bind(view, obj);

This will throw a System.ArgumentException with the error Object of type 'Employee' cannot be converted to type 'System.String'.