I found a very useful article that did just this. I needed to introduce some base class logic for my View and ModelView:
http://karlshifflett.wordpress.com/mvvm/input-validation-ui-exceptions-model-validation-errors/
This solution had the added benefit that it made the binding exception errors more readable to the user when viewing them through the tool tip.
To get the validation solution to work, I needed to do several things:
- Make all my bindings TwoWay rather than OneWayToSource.
- Make all of my ModelView properties call NotifyPropertyChange, when set.
- Turn NotifyOnValidationError, ValidatesOnDataError and ValidatesOnException on on all my bindings.
- Use a RelayCommand instead of a DelegateCommand.
- I needed to change the type of the view from UserControl to BaseView
.
http://www.codeproject.com/Articles/37317/Generic-Support-In-XAML
Next up is to start working on adding manuscripts to a job. Firstly I want the new job screen to close on successful save and a new screen open that shows the job title, number, contact name and process icons and provide a way to add the new manuscripts.
No comments:
Post a Comment