I have a C# WPF MVVM application that works fine.
The only problem is when I modify a textbox and click on the menu. If I do that without clicking on another control, the view->viewmodel event is never fired because the textbox hasn't lost focus. Correct me if I am wrong, but I think the RaisePropertyChanged is only fired on LostFocus (or OnBlur, or any similar event).
So, clicking on the menu save button right after editing the textbox causes the viewmodel to save the data using old values.
So, resuming:
This sequence works fine:
- Edit the text box
- Click on another control
- RaisePropertyChanged is fired, the viewmodel is updated
- Click on save button on the menu
- Data Saved with correct values
This sequence gives me an error:
- Edit the text box
- Click on save button on the menu
- Data Saved with correct values
How to solve this?