我有一个 Silverlight 4 应用程序,并以编程方式在对象上设置了一些绑定(bind),例如:
Binding bBorder = new Binding();
bBorder.Source = CellItem;
bBorder.Mode = BindingMode.OneWay;
bBorder.Path = new PropertyPath("Border");
appointmentItem.SetBinding(AppointmentItem.BorderBrushProperty, bBorder);
无论任何最佳实践经验如何,如果这段代码运行两次,我最终会得到已注册两次的绑定(bind),还是第一个绑定(bind)已正确删除?
谢谢, 蒂姆
最佳答案
第一个绑定(bind)将被删除,并且仅注册一个绑定(bind)。
关于silverlight - 在 Silverlight 应用程序中调用 SetBinding() 两次?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13800366/