I'd like to make a DateTimePicker where the available time-of-day values depend on the day chosen.
I was thinking I could just bind the ClockItemsSource to an ObservableCollection, and then change the contents of the collection depending on the day chosen.
Here's my simplified XAML:
And the code-behind looks like this:
VoyagePicker : UserControl
DateTimepicker.ClockItemsSource = m_selectedDayVoyageTimes;
TimeSpan(10, 11, 12));
DateTimepicker.SelectionChanged += DateTimepicker_SelectionChanged;
ObservableCollection<TimeSpan> m_selectedDayVoyageTimes =
sender, SelectionChangedEventArgs e)
TimeSpan(14, 15, 16));
The problem is that the time-of-day values displayed never change - it is as if the time picker ignores the ObservableCollection change events!
Can anyone tell me what I'm doing wrong - or if there's a way to force the time picker to update itself?
We're approaching a deadline, and I'm really
stuck here - any help would be greaty appreciated!