Hi,
I am trying to bind the property "Selectedtimerange" as follow
<ig:XamOutlookCalendarView PreferredCalendarGroupVerticalExtent="NaN" SelectedTimeRange="{Binding xamOutlookCalendarView_SelectedTimeRange}"
ViewModel:
private DateRange xamOutlookCalendarView_selectedTimeRange; public DateRange xamOutlookCalendarView_SelectedTimeRange { get { if (allRequests.Rows.Count > 0) xamOutlookCalendarView_selectedTimeRange = new DateRange(DateTime.Parse(allRequests.Rows[0]["filterStartDate"].ToString())); else xamOutlookCalendarView_selectedTimeRange = new DateRange(factoryModel.GetServerDate(this.MainModelPage.SelectedFactory.FactoryID)); return xamOutlookCalendarView_selectedTimeRange; } set { xamOutlookCalendarView_selectedTimeRange = value; OnPropertyChanged("xamOutlookCalendarView_SelectedTimeRange"); } }
The correct value is loaded for the first time, but later, I can see the value changing in ViewModel but not reflecting in View.
Appreciate your help!
Thanks!
I'm glad you got it working but I would have thought the issue was that you didn't set the Mode in the Binding to TwoWay and therefore when the control set the SelectedTimeRange (which would happen when you click on a timeslot, etc) that the Binding would have been removed since the binding would have been OneWay by default.
Got it working by using the following
SelectedTimeRange="{Binding xamOutlookCalendarView_SelectedTimeRange, UpdateSourceTrigger=PropertyChanged}"