WPF - How to programatically PAUSE databinding
I have a textbox that is bound (oneway) to a datatable that updates a couple of time a second. So the textbox value continually reflects changes in datatable. When I enter the textbox to manually set a value, the binding causes the value to continually be overwritten. How do I stop this? When I have entred a value (textbox lost focus) I want the textbox to return to display the bound value and not the value I have just entered manually.
Plase note that the textbox is one of many ... each attached to a field in a DataTable. I do not want the datatable to stop sending updates to the other textboxes while I alter one textbox. Note it is OneWay binding.
I don't believe I can prevent update on a single field in a DataTable.
Also is it not possile to remove binding and reset it programatically .. rather than controlling the sourse that is updating?
Re: WPF - How to programatically PAUSE databinding
Rather than bind to the datatable directly use a design pattern such as MV-VM and bind to a view model instead. The view model could then control the binding through a variety of means. One way is for the view model to create a copy of the item getting edited and only after the editing is completed would the view model copy the data to the actual model.