【问题标题】:Automatically select a date in an UWP CalendarView在 UWP CalendarView 中自动选择日期
【发布时间】:2017-08-09 03:15:36
【问题描述】:

在我的 UWP 应用中,我希望在 CalendarView 上自动选择当天,但我无法更改 SelectedDates 属性的值。

【问题讨论】:

    标签: c# uwp calendarview


    【解决方案1】:

    由于SelectedDatesList,您不能直接为SelectedDates 分配新值。如果您使用SelectionMode="Single",则使用Clear 列表并使用Add

    MyCalendarView.SelectedDates.Clear();
    MyCalendarView.SelectedDates.Add(DateTimeOffset.Now);
    

    【讨论】:

      猜你喜欢
      • 2023-02-18
      • 1970-01-01
      • 2012-04-29
      • 2018-07-14
      • 2017-05-01
      • 1970-01-01
      • 2016-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多