数据绑定POCO属性 [英] Data Binding POCO Properties

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

问题描述

是否有任何数据绑定框架(BCL或其他)允许在实现 INotifyPropertyChanged 和<$ c $的任何两个CLR属性之间绑定c> INotifyCollectionChanged ?似乎应该可以这样做:

  var binding = new Binding(); 
binding.Source = someSourceObject;
binding.SourcePath =Customer.Name;
binding.Target = someTargetObject;
binding.TargetPath =Client.Name;
BindingManager.Bind(binding);

其中 someSourceObject someTargetObject 只是实现 INotifyPropertyChanged 的POCO。但是,我不知道有什么BCL对此的支持,不知道现有的框架是否允许这样做。



更新:给定没有现有的图书馆可用,我已经把它自己写下来了。 这里可用。



谢谢

解决方案

我写了桁架< a>填补空白。


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属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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