Search This Blog

Sunday, May 12, 2019

Set current date WPF calendar

WPF -> Calendar

calendar.DisplayDate = new DateTime(2020, 4, 17);
calendar.SelectedDate = new DateTime(2020, 4, 17);


Wednesday, May 8, 2019

WPF Calendar SelectedDates

WPF->Calendar

Add multiple selected dates to WPF Calendar.

<Grid>
   <Calendar x:Name="calendar" />

</Grid>

calendar.SelectionMode = CalendarSelectionMode.MultipleRange; 
calendar.SelectedDates.Add(new DateTime(2020, 1, 1)); 
calendar.SelectedDates.Add(new DateTime(2020, 1, 2));