I'm extending the RadDatePicker. I have implemented a new property that tells whether the text input in the DatePicker is valid (that is if can be parsed to a DateTime):
/// Tells whether the input in the TextBox of this DatePicker is valid. This property is
/// updated continously as the user types in the TextBox.
DependencyProperty IsInputValidProperty = DependencyProperty.Register(
I'm setting the value of this property in an event handler for the ParseDateTimeValue event:
sender, ParseDateTimeEventArgs args)
//If RadDatePicker could not parse the input...
//HERE I DO SOME EXTRA PARSING FOR INPUT THAT I WANT TO SUPPORT
//BUT THAT IS NOT SUPPORTED BY RadDatePicker. IN ALL CASES
//WHERE THE PARSING IS SUCCESFUL AND A DATETIME IS SET, I
//ALSO SET args.IsParsingSuccessful TO TRUE.
IsInputValid = args.IsParsingSuccessful;
//The input was succesfully parsed by the default parsing in the RadDatePicker.
This seems to work fine. But the problem is that if the user deletes the text in the input the event is NOT dispatched and thus my method is not executed. If the user provides some invalid input so that my IsInputValid property is set to false and then clears the input, IsInputValid will still be false! I want to set it to true when the input is empty (this will mean that the value of the DatePicker is null which is allowed in my case).
So my question is: Is it possible to get notified in some way when the input is cleared by the user?