WPF MVVM UpdateSourceTrigger=Excplict -


I have content control in my WPF-App (MVVM), which is bound to the object and the object properties in the text box Displays, therefore users can edit the values ​​of properties. I want to implement the restructuring / re-work with the command pattern of GoF. For this, I need a point where I can make commands and set it in my Andaman. My idea was to add a submitbutton when the button is pressed, then I update the sources of the text box (my properties) and make my object an object to make the changes removable (the old state of the object and the new Save the state). But: - To use a submit button I need to clear the textbox's update circਸਰ. If I want to update my sources then I need to refer to the controls in my view, which is as bad as I have learned. How can I do that? With MVVM I have to make a Command for SubmitButton (do not have WPF command, not my undo redo command), but I do not think how to apply the changes made in the properties of that command without reference to the text box (and then Are generated through the dataplate).

Thanks Walter

I accept my textbox Controls are bound to properties in the ViewModel class if you add your submit button to a command command , then in return you can replace the command pattern store Can add appropriate commands and also change some ViewModel properties, will also be updated in the textbox controls. Now, for a textbox to update the value when the value of an asset is bound to change, then the need to implement the ViewModel class INotifyPropertyChanged


Comments