I have the following xaml, what I trying to do is select the whole week when user selects any day.
<sfCalendar:SfCalendar SelectionMode="RangeSelection" SelectionChanged="SfCalendar_OnSelectionChanged" />
I tried to use the below code.
private void SfCalendar_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (sender is SfCalendar sfCalendar && sfCalendar.SelectedDates.Count > 0)
{
var date = sfCalendar.SelectedDates.First();
sfCalendar.SelectedRange = new SelectionRange(
date.AddDays(-(int)date.DayOfWeek+1),
date.AddDays(-(int)date.DayOfWeek + 7));
// If I commend the bellow code the ui is not updating but this produce something like a glitch in ui.
sfCalendar.NavigateTo(date.AddMonths(-1));
sfCalendar.NavigateTo(date);
}
}