Esempio n. 1
0
            async Task Update()
            {
                for (var row = 0; row < 4; row++)
                {
                    for (var column = 0; column < 3; column++)
                    {
                        var button = new Calendar.ItemButton
                        {
                            Text = DateTimeFormatInfo.CurrentInfo.MonthNames[(row * 3) + column],
                            Date = new DateTime(startDate.Year, (row * 3) + column + 1, 1),
                            Id   = "Month"
                        };

                        button.Tapped.HandleWith(() => MonthTapped.Raise(button.Date.Value));
                        await Add(button);
                    }
                }
            }
Esempio n. 2
0
 async Task Update()
 {
     YearButtons.Clear();
     for (var row = 0; row < YearRows; row++)
     {
         for (var column = 0; column < YearColumns; column++)
         {
             var temp   = (row * YearColumns) + column + 1;
             var button = new Calendar.ItemButton
             {
                 Text = $"{startDate.Year + (temp - (YearColumns * YearRows / 2))}",
                 Date = new DateTime(startDate.Year + (temp - (YearColumns * YearRows / 2)), startDate.Month, 1),
                 Id   = "Year"
             };
             button.Tapped.HandleWith(() => YearTapped.Raise(button.Date.Value));
             YearButtons.Add(button);
             await Add(button);
         }
     }
 }