I have a ChildWindow (Ok, Cancel buttons) that contains binded controls. I want the behind object to be updated only when pressing the ‘OK’ button. What’s the best way to do it?
I have a ChildWindow (Ok, Cancel buttons) that contains binded controls. I want the
Share
You need to set the UpdateSourceTrigger property of the bindings to Explicit. Then, on clicking OK, you call UpdateSource() on the Binding:
Or you don’t bind the ChildWindow to the original ViewModel but use a temporary and assign its values to the original on OK