I'm using the XamOutlookCalendarView in conjunction with the XamDateNavigator and I would like to be able to force (possibly via MVVM) the SelectedDates.
Since the SelectedDates property is readonly I don't know how to do it.
Is there a way?
Can I persist the SelectedDates property value and reapply it?
Even if I use the binding of the SelectedDate as soon as I load the control hosting the XamDateNavigator it defaults to DateTime.Today.
Best Regards
Roberto Dalmonte
Hello Roberto,
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thank you for your feedback. As I have already mentioned earlier in our discussion, the functionality that you are looking for, is not currently supported and I have submitted a feature request for you, for ability to bind the SelectedDates property of the XamDateNavigator. If your feature request is picked up for development you will be notified by an email.
If you have any further questions on the matter please do not hesitate to ask.
Hello Krasimir,
thank you for your availability.Forgive me if I insist.While I understand the explanations given, I wonder if would be possible to offer the possibility of binding it, given those limitations: the binding should NOT be OneWay, otherwise the binding will be lost.The developer will also be responsible for indicating what happens when the property is bound: reset or modify it? Furthermore the property in the viewmodel must be of some specific type.
I will sign right now to have this possibility, given some (known) limitations.
What about an attribute (in your namespace) that the developer must use in order to explicitly characterize a collection property in his/her viewmodel?
Roberto
Hello,
Thank you for your patience. After reviewing the question that you are having, our Development Team has informed me that the reason for the collection properties like the SelectedDates property of the XamDateTimeNavigator is read-only, since binding properties collection properties that are manipulated by the control may cause several issues if those properties can be bund to the ViewModel. One of the issues that may occur is that, when bound the value of the property becomes a local value. If the Binding is OneWay, then the binding will be stopped when the control sets the value (for example when the user change the selected dates) and the Binding will be lost.
It is difficult to determine should the collection be reset or should it be modified, when the bound property is changed. Also in some cases the type of the collection should be of some specific types in order to provide specific functionality. For example when the SelectedDates derived for the DateColleciton class. This is done in order to provide functionality for validating the dates in the collection. For example, to ensure that the values in the collection are in the allowed range of dates that can be used and also to ensure that there is not duplicate dates in the collection. Since the SelectedDates should have this implementation for providing the proper work of the control, providing the binding ability for such property will need the ViewModel property to be from the same type ( in that case form the DateCollection type).