There were a couple of very good treatments that I found. The process is as follows:
- Create the Min and Max Properties in the View Model.
- Create a class derived from ValdationRule.
- Create a wrapper class derived from DependencyObject. The Dependency Properties will represent the min and max that you need.
- Add a property of the wrapper class in the Validation Rule.
- Create a class derived from Freezable that will enable the View to access the DataContext and pass values to the wrapper.
- Add the elements to the View. If done properly, the Min and Max needed by the wrapper can be set to values defined in the ViewModel.
No comments:
Post a Comment