两种方法:

1、通过后台赋值:

this.datePicker.SelectedDate = DateTime.Now;

2、前台控件的属性直接赋值

xmlns:sys="clr-namespace:System;assembly=mscorlib"  
  
<DatePicker SelectedDate="{x:Static sys:DateTime.Now}" />

相关文章:

  • 2021-06-21
  • 2022-12-23
  • 2021-12-22
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2021-08-11
相关资源
相似解决方案