开发者

What's the simplest way to detect edits to bound Silverlight controls or a RIA data object?

I want to enable/disable my Save & Cancel button as soon as an edit occurs. I'm using Silverlight 4, WCF RIA services, Entity Framework 4 and the DomainDataSource contr开发者_如何学Pythonol. I'm not using the DataForm because my many controls wouldn't fit nicely. Instead I use individual controls (TextBoxes, DropDowns etc.) arranged by category on a TabControl. Still, I'd like to mimic some of the DataForm behavior. It reacts the moment an edit occurs on any control. I've followed the example here but the example reacts to edits on a DataGrid only. I want to react to edits to bound TextBoxes and other controls. Is there any event I could use to detect when an edit has begun? I've searched for events on the underlying DomainContext and the DomainDataSource or related objects, but so far I haven't found what I'm looking for. Any help would be appreciated.


Not sure if you still need help with this but we Implement the System.ComponentModel.IChangeTracking interface and this does what you are after.

If you need help with this we have it going in our project and I can give you further details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜