protected override void OnNavigatedTo(NavigationEventArgs e)
{
datepicker.DataContext = e.Parameter;
time.DataContext = e.Parameter;
}
<DatePicker Name="datepicker" Header="Date" Date="{Binding Date}"/>
<TimePicker Name="time" Header="Time" Time="{Binding Time}"/>
I have a listbox of entries of type Reminder on a page. I select one of the items and navigate to the next page, passing the ListBox.SelectedItem. I want to be able to bind the date passed from the previous page to the DatePicker on the current page. I am able to bind the time to the TimePicker, but not the date to the DatePicker.
Any suggestions on how I can do this?
Dateproperty is of typeDateTime. On the other hand, theDatePicker.Dateproperty is of typeDateTimeOffset. So you'll probably need to convert it toDateTimeOffsettype. I could be more sure if I could take a look at yourReminderclass. - Abhishek