예제 #1
0
        void DayPicker_OnNumberChanged(int day)
        {
            SelectedDate = new DateTime(SelectedDate.Year, SelectedDate.Month, day);

            SetLimits();

            OnDateChanged?.Invoke(SelectedDate);
        }
예제 #2
0
        void YearPicker_OnNumberChanged(int year)
        {
            int day         = SelectedDate.Day;
            int daysInMonth = DateTime.DaysInMonth(year, SelectedDate.Month);

            if (daysInMonth < day)
            {
                day = daysInMonth;
                dayPicker.CurrentValue = day;
            }

            SelectedDate = new DateTime(year, SelectedDate.Month, day);

            SetLimits();

            OnDateChanged?.Invoke(SelectedDate);
        }
예제 #3
0
        private async void PreviousButton_Clicked(object sender, EventArgs e)
        {
            eventsView.Children.Clear();

            Date = Date.AddMonths(-1);

            var offset = Width + 50;
            var rect   = calendarGrid.Bounds.Offset(offset, calendarGrid.Bounds.Y);
            await calendarGrid.LayoutTo(rect, animationTimeout, Easing.CubicOut);

            FillGrid();

            rect = calendarGrid.Bounds.Offset(-offset * 2, calendarGrid.Bounds.Y);
            await calendarGrid.LayoutTo(rect, 50, Easing.CubicIn);

            rect = calendarGrid.Bounds.Offset(offset, calendarGrid.Bounds.Y);
            await calendarGrid.LayoutTo(rect, animationTimeout, Easing.CubicOut);

            OnDateChanged.Invoke(this, EventArgs.Empty);
        }