其中 someSourceObject 和 someTargetObject 只是实现 INotifyPropertyChanged 的POCO。但是,我不知道有什么BCL对此的支持,不知道现有的框架是否允许这样做。
更新:给定没有现有的图书馆可用,我已经把它自己写下来了。 这里可用。
谢谢
解决方案我写了桁架填补空白。
Are there any data binding frameworks (BCL or otherwise) that allow binding between any two CLR properties that implement INotifyPropertyChanged and INotifyCollectionChanged? It seems to be it should be possible to do something like this:
var binding = new Binding(); binding.Source = someSourceObject; binding.SourcePath = "Customer.Name"; binding.Target = someTargetObject; binding.TargetPath = "Client.Name"; BindingManager.Bind(binding);Where someSourceObject and someTargetObject are just POCOs that implement INotifyPropertyChanged. However, I am unaware of any BCL support for this, and am not sure if there are existing frameworks that permit this.
UPDATE: Given that there is no existing library available, I have taken it upon myself to write my own. It is available here.
Thanks
解决方案I wrote Truss to fill the void.
更多推荐
数据绑定POCO属性
发布评论