protected Task OnSelectNextMonth() { return(OnNavigateDate.InvokeAsync(new NavigatedDateResult() { Date = NavigatedDate.AddMonths(1), FocusOnNavigatedDay = false })); }
private void OnSelectMonth(int newMonth) { // If header is clickable the calendars are overlayed, switch back to day picker when month is clicked if (OnHeaderSelect.HasDelegate) { OnHeaderSelect.InvokeAsync(true); } OnNavigateDate.InvokeAsync(new NavigatedDateResult() { Date = NavigatedDate.AddMonths(-1 * (NavigatedDate.Month - newMonth)), FocusOnNavigatedDay = true }); }
protected Task OnSelectYear(int selectedYear) { focusOnUpdate = true; var navYear = NavigatedDate.Year; if (navYear != selectedYear) { var newNavDate = new DateTime(NavigatedDate.Year, NavigatedDate.Month, NavigatedDate.Day); newNavDate = newNavDate.AddYears(selectedYear - newNavDate.Year); if (newNavDate > MaxDate) { newNavDate = newNavDate.AddMonths(MaxDate.Month - newNavDate.Month); } else if (newNavDate < MinDate) { newNavDate = newNavDate.AddMonths(MinDate.Month - newNavDate.Month); } OnNavigateDate.InvokeAsync(new NavigatedDateResult { Date = newNavDate, FocusOnNavigatedDay = true }); } IsYearPickerVisible = false; return(Task.CompletedTask); }
protected Task OnSelectNextYear() { return(OnNavigateDate.InvokeAsync(new NavigatedDateResult { Date = NavigatedDate.AddYears(+1), FocusOnNavigatedDay = false })); }