Reputation: 269
In my UWP app, I want the current day to be automatically selected on a CalendarView
, but I can't change the value of the SelectedDates
property.
Upvotes: 0
Views: 302
Reputation: 5837
Since SelectedDates
is List
you can't directly assign a new value to SelectedDates
. If you use SelectionMode="Single"
then Clear
the list and use Add
.
MyCalendarView.SelectedDates.Clear();
MyCalendarView.SelectedDates.Add(DateTimeOffset.Now);
Upvotes: 2