I have 2 - XamDateTimeInput controls (Start & End dates), and I want to disable a Button control whenever either of these XamDateTimeInput controls have invalid input. Is there a way to do this in XAML?
Hello PMac,
Thank you for your feedback. I am glad to know that I was able to help you achieve the functionality you were looking for. I believe this thread can help other people looking for a similar solution.
If you require any further assistance on this matter, please do not hesitate to ask.
Awesome, this worked. Thank you!
Hello PMac, The red warning message you have referred to is caused by the inability of the ValueConverter to convert the current value by returning null. In order to prevent this from happening, you can set the property you are binding to of a nullable type. This way the ValueConverter will accept the value whenever it is null as well and you should not be getting the message. public DateTime? FirstValue { get; set; } <ig:XamDateTimeInput x:Name="inputA" Value="{Binding FirstValue}" /> I have modified and attached my previous sample by binding the first input to a nullable DateTime property and the second input to a normal DateTime property. This way you should be able to see the difference. For more detailed information, you can take a look at the following thread, where a similar issue has been discussed. If you require any further assistance on the matter, please let me know.
Ah, I see the property now. Thank you. But this only prevents the Dialog Message pupup box from displaying the error. The case that I am trying to suppress is the inline red warning message that is displayed as you type in the date. Is there a way to turn that feature off?
Hello PMac, The InvalidValueBehavior exists in the WPF 14.1 Product version. For more detailed information on the property, you can take a look at Using XamDateTimeInput and InvalidValueBehavior Property and make sure you are using all the required assemblies for the control.