private void SelectedDate(object obj) { DateTime _date = (DateTime)(obj); var Index = ListofDates.IndexOf(_date.Date); Date = ListofDates[Index].Date; }
/// <summary> /// Get Next date /// </summary> public async void NextDateExecute() { if (ListofDates.IndexOf(Date) < ListofDates.Count - 1) { Date = ListofDates[ListofDates.IndexOf(Date) + 1].Date; } else { await Application.Current.MainPage.DisplayAlert("Alert!", "Maximum date", "Ok"); } }
/// <summary> /// Get Previous date /// </summary> public async void PreviousDateExecute() { if (ListofDates.IndexOf(Date) != 0) { Date = ListofDates[ListofDates.IndexOf(Date) - 1].Date; } else { await Application.Current.MainPage.DisplayAlert("Alert!", "Minimum date", "Ok"); } }