Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
XamDateTimeEdiotr binding issue in MVVM
posted

I am having a DataTimeEditor in my window, when ever i change the date its setting in the property of my ViewModel but when i delete the date completely then(making it be empty) at this point its not at all hitting my setter property of my ViewModel. Is this the default behavior of this editor, if so how can i overcome this issue?

Parents
  • 28407
    posted

    HI,

     Your issue may be due to validation errors. Your ViewModel date property is not nullable.

     I am attaching a sample project, with two datetime controls both bound to properties in my ViewMOdel  The first date is not nullable the second date is nullable.

     When you clear the first datetime control, you get a red box around it and the setter is not hit.

     The if you clear the second datetime control, you get to the setter.

     Please review my sample.

    WpfApplication324.zip
Reply Children