Hi, I have kind of a dumb question about XamCalendar.
Is it actually possible for me to pick up events when a previously selected date has been clicked? SelectedDatesChanged obviously won't fire and the mousebutton events don't seem reliable either.
Hi Matti,Is this question regarding the XamCalendar within the context of Silverlight or WPF?Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support
Whoops, right, this would be Silverlight.
So, I assume that the control can't reliably inform me when selected date is clicked? Only when it's changed to something else?
I have attempted to get the mouse button events to determine when the calendar was clicked in general and work my way from there, but they don't seem to fire on all cases either.
Hi Matti,I have been looking into this behavior for you and while there are no event handlers exposed from the Silverlight XamSchedule for monitoring changes to it’s selected data, I believe that this behavior should be possible by creating your own dependency property, in which case you would need to provide a PropertyChanged event and bind the before stated dependency property to the XamCalendar’s SelectedDate property.The WPF variant of this control would have been a bit more straight forward as it exposes the TargetUpdated event handler, offered by WPF, which could potentially be used to monitor changes to the selected date, but SL does not offer this feature.
If you have any further questions, please let me know.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support
Well, I can't just bind to the existing SelectedDate property since the Selected date won't actually change when the existing selected date is clicked so the binding doesn't react to it (I'm not selecting a new date after all, just clicking on already selected one). If I instead create a custom inherited version of the control that overrides the SelectedDate completely I could get the event even when the date stays the same, but then I would probably get those events whenever anything changes the SelectedDate, not just when user clicks on it?
The problem is that I have to react specifically to user input when they select the already selected date on the calendar (or any date, but already selected date is the one that causes problems here), I can't just run the code whenever something alters the SelectedDate.
Hi Matti,
You could certainly create your own control by inheriting it from the XamCalendar in order to implement your own custom behaviors, but this is beyond the scope of what we offer support for; in this case though, it may be the only way to achieve the behavior that you are interested in producing.
If you were able to listen to the events which are fired when the SelectedDate changes, (in reality there are probably several events used simultaneously to determine if the user has selected an element, which would change the selected date) you would likely see that these events fire whether the SelectedDate actually changes or not.
As this behavior is not directly supported by the XamCalendar, I have submitted product idea, PI13070006; to have event handlers exposed which would allow you to listen for instances where the SelectedDate is changed as well as when a new date is selected, but the SelectedDate value is unchanged, considered for implementation into a future release.
If you would like to follow up on your product idea at a later point, you may contact Developer Support management via email. Please include the reference number of your product idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
If you have any further questions that I may assist you with, please let me know.
Sincerely, Chris K Developer Support Engineer Infragistics, Inc. www.infragistics.com/support