コード例 #1
0
 protected Task OnSelectNextMonth()
 {
     return(OnNavigateDate.InvokeAsync(new NavigatedDateResult()
     {
         Date = NavigatedDate.AddMonths(1), FocusOnNavigatedDay = false
     }));
 }
コード例 #2
0
 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
     });
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 protected Task OnSelectNextYear()
 {
     return(OnNavigateDate.InvokeAsync(new NavigatedDateResult {
         Date = NavigatedDate.AddYears(+1), FocusOnNavigatedDay = false
     }));
 }