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
1325
XamDateTimeEditor binding issue
posted

I'm trying to create a custom date range user control which contains two XamDateTimeEditor ('DateFrom' and 'DateTo'). Also it has 2 dependency properties named in the same way. XamDateTimeEditor controls' Value properties are binded to corresponding property. There is a small validation logic that doesn't allow DateTo to be less that DateFrom and DateFrom to be bigger that DateTo. This is done by using CoerceValueCallbacks defined for user control's properties. Validation works ok but XamDateTimeEditor still display value that is set by user, for example:  DateFrom is set to 29/03/2010 and DateTo is set to 30/03/2010. Then I set DateTo editor value to 28/03/2010 - user control's property value is reseted to 29/03/2010 but XamDateTimeEditor control displays 28/03/2010. I assume that if it's binded to property it should be also reseted to 29/03/2010. Is it some kind of issue or I'm doing something wrong? I've attached sample project.

XamDateTimeEditorIssue.zip