I have class with such properties:
public DateTime Start { get; set; }
public DateTime Finish { get; set; }
And such ViewModel:
<StackPanel>
<DatePicker SelectedDate="{Binding Start}" />
<DatePicker SelectedDate="{Binding Finish}" />
</StackPanel>
I want to enable validation. So, when Start > Finish there must be error. What is the simplest way to provide such validation?
Well, I’ve found answer myself) I extended my TimeRange class to implement IDataErrorInfo interface like this:
And then change my xaml code to: