Well, I'm a little newbie with MVVM, so please any suggestions and suggestions are welcome :)
I want to track the username and password, and the user can set this in the Settings view. In SettingsViewModel, I have 2 properties for these two fields that are bound to text fields in the view. I added the "Save" button on the application panel and through RelayCommand it launches the method in ViewModel when the user clicks on it.
Now what's wrong:
When a user enters a text field and does not exit it, but presses the save directly, the value is not yet bound to the data. So how do you solve this? The only way to use the coding4fun function: TextBoxBinding.UpdateSourceOnChange = "True" from the coding4fun library?
When a user enters data in a text field, and this is a database link, leaving the settings page and returning to it, it will still save this data. How to do this if the user has not clicked the save button? The point is that you are saving data on the page when it has not yet been saved ... But since I use MVVMLight, the page is statically created in ViewModelLocator and remains "active" as long as the program runs.
Well, as I said, any hints, tips, suggestions are welcome :)
source
share