【发布时间】:2014-03-13 06:29:30
【问题描述】:
当复选框被选中时,我希望能够获取 datepicker/timepicker 的值。发生的事情是它能够获取该值,但是当我尝试更改该值时,它不会更改,因为它只会返回到以前的值。我做错了什么?以下是我的代码:
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (NavigationContext.QueryString.ContainsKey("Id"))
{
Id.Text = NavigationContext.QueryString["Id"];
}
ScheduledAction currentReminder = ScheduledActionService.Find(NavigationContext.QueryString["Id"]);
if (currentReminder == null)
{
cBox.IsChecked = false;
}
else
{
cBox.IsChecked = true;
rrDate.Value = currentReminder.BeginTime;
hiddenTime.Text = rrDate.Value.ToString();
rrTime.Value = DateTime.Parse(hiddenTime.Text);
}
}
【问题讨论】:
-
OnNavigatedTo call 是对 datpickers 和 timepickers 上设置的每个值的免费礼物。
标签: c# windows-phone-7 windows-phone-8 datepicker timepicker