void Handle_SelectionChanged(object sender, Syncfusion.SfCalendar.XForms.SelectionChangedEventArgs e) { if (e.DateAdded != null) { inCreationVotedDates = new List <DateTime>(e.DateAdded); inCreationVotedDates.Sort(); votedDatesListView.ItemsSource = inCreationVotedDates; } else { votedDatesListView.ItemsSource = new string[1] { "<Sin fechas seleccionadas>" }; } //inCreationVotedDates = new ObservableCollection<DateTime>(e.DateAdded); //votedDatesListView.ItemsSource = inCreationVotedDates; //IList<DateTime> deselectedDates = e.DateRemoved; //new VotedDate(voteLimit, new User(App.admin.Id, App.admin.Nickname)), }
private void Calendar_SelectionChanged(Syncfusion.SfCalendar.XForms.SfCalendar sender, Syncfusion.SfCalendar.XForms.SelectionChangedEventArgs e) { if (sender.SelectedRange != null) { //access to selectedRange var startDateObj = (Syncfusion.SfCalendar.XForms.SelectionRange)sender.SelectedRange; startDate = startDateObj.StartDate.Date; var endDateObj = (Syncfusion.SfCalendar.XForms.SelectionRange)sender.SelectedRange; endDate = endDateObj.EndDate.Date; var dateRange = Enumerable.Range(0, 1 + endDate.Subtract(startDate).Days) .Select(offset => startDate.AddDays(offset)) .ToArray(); Label_Start.Text = startDate.ToString("dd/MM/yyyy"); Label_End.Text = endDate.ToString("dd/MM/yyyy"); } }