Silverlight 数据绑定注意问题

在silverlight中,如果如果为某一个依赖属性设置了绑定信息,则不能再通过代码直接设置这个属性的值,否则该属性原有的绑定信息就会被删除。 MSDN上给出的解释是:

In terms of dependency property precedence, a Binding expression is equivalent to a locally set value. If you set a local value for a property that previously had a Binding expression, the Binding is completely removed.

大意是说: 从依赖项属性优先级考虑,Binding 表达式等效于本地设置的值。如果为先前已具有 Binding 表达式的属性设置了本地值,则会完全移除 Binding。
posted @ 2009-10-16 17:27  张志敏  阅读(576)  评论(2编辑  收藏  举报