Hi,
I can't find the RecurrenceEditor control in the WPF library.
There is one in the Blazor library which works perfectly, I need to create a custom appointment edit window with the recurrence editor on the form. What's the best way to do this using the WPF library?
Thanks in advance, Lee.
Hi SaiGanesh,
We just need a control to amend the recurrence rule. The built in appointment editor in the WPF library has the recurrence editor on it, is this not encapsulated within its own control?
On blazor, you simply do the following to display a recurrence editor:
<SfRecurrenceEditor @bind-Value="@vm.Model.RecurrenceRule"
StartDate="@vm.Model.DStart.DateTime" />
I cannot find the equivalent in the wpf library, however as mentioned above the functionality is obviously there as it is present on the default appointment edit form from your demo. (Screenshot attached)
Thanks, Lee.
|
if (appointment.IsRecursive)
{
var id = appointment.Type == AppointmentType.ChangedOccurrence ? appointment.RecurrenceId : appointment.Id;
var parentAppointment = (ScheduleAppointment)this.GetParentAppointment(id);
this.appointment = parentAppointment;
SchedulerRecurrenceProperties = RecurrenceHelper.RRuleParser(appointment.RecurrenceRule, appointment.StartTime);
if (SchedulerRecurrenceProperties.RecurrenceType == RecurrenceType.Daily)
{
this.Repeat.Visibility = Visibility.Visible;
this.Repeat.Value = SchedulerRecurrenceProperties.Interval;
this.Recurrence.Text = "Daily";
if (SchedulerRecurrenceProperties.RecurrenceRange == RecurrenceRange.NoEndDate)
{
this.DailyRecurrenceUntil.Visibility = Visibility.Collapsed;
this.DailyRecurrenceRepeat.Visibility = Visibility.Collapsed;
this.End.Text = "Never";
}
else if (SchedulerRecurrenceProperties.RecurrenceRange == RecurrenceRange.EndDate)
{
this.DailyRecurrenceUntil.Visibility = Visibility.Visible;
this.DailyRecurrenceRepeat.Visibility = Visibility.Collapsed;
this.DailyRecurrenceUntil.Value = SchedulerRecurrenceProperties.EndDate;
this.End.Text = "UNTIL";
}
else
{
this.DailyRecurrenceUntil.Visibility = Visibility.Collapsed;
this.DailyRecurrenceRepeat.Visibility = Visibility.Visible;
this.DailyRecurrenceRepeat.Value = SchedulerRecurrenceProperties.RecurrenceCount;
this.End.Text = "Count";
}
}
}
else
{
this.Recurrence.Text = "Never";
this.End.Text = "Never";
this.Repeat.Visibility = Visibility.Collapsed;
this.End.Visibility = Visibility.Collapsed;
this.DailyRecurrenceUntil.Visibility = Visibility.Collapsed;
this.DailyRecurrenceRepeat.Visibility = Visibility.Collapsed;
} |
|
private void OnSaveClicked(object sender, RoutedEventArgs e)
{
if (appointment == null)
{
var scheduleAppointment = new ScheduleAppointment();
scheduleAppointment.Subject = this.Subject.Text;
scheduleAppointment.StartTime = this.StartDatePicker.Value.Value.Date.Add(this.StartTimePicker.Value.Value.TimeOfDay);
scheduleAppointment.EndTime = this.EndDatePicker.Value.Value.Date.Add(this.EndTimePicker.Value.Value.TimeOfDay);
scheduleAppointment.Location = this.location.Text;
scheduleAppointment.IsAllDay = (bool)this.allDay.IsChecked;
scheduleAppointment.Notes = this.description.Text;
scheduleAppointment.Reminders = (ObservableCollection<SchedulerReminder>)this.ReminderList.ItemsSource;
if ((bool)this.timeZone.IsChecked)
{
scheduleAppointment.StartTimeZone = this.TimeZoneMenu.Text;
scheduleAppointment.EndTimeZone = this.TimeZoneMenu.Text;
}
if (this.scheduler.ItemsSource == null)
{
this.scheduler.ItemsSource = new ScheduleAppointmentCollection();
}
if (this.Recurrence.Text != "Never")
{
if (this.DailyRecurrenceRepeat.Value != null)
{
SchedulerRecurrenceProperties.RecurrenceCount = (int)this.DailyRecurrenceRepeat.Value;
}
if (this.Repeat.Value != null)
{
SchedulerRecurrenceProperties.Interval = (int)this.Repeat.Value;
}
if (this.DailyRecurrenceUntil.Value >= scheduleAppointment.StartTime.Date)
{
SchedulerRecurrenceProperties.EndDate = (DateTime)this.DailyRecurrenceUntil.Value;
}
scheduleAppointment.RecurrenceRule = RecurrenceHelper.CreateRRule(SchedulerRecurrenceProperties, scheduleAppointment.StartTime, scheduleAppointment.EndTime);
}
(this.scheduler.ItemsSource as ScheduleAppointmentCollection).Add(scheduleAppointment);
}
else
{
appointment.Subject = this.Subject.Text;
appointment.StartTime = this.StartDatePicker.Value.Value.Date.Add(this.StartTimePicker.Value.Value.TimeOfDay);
appointment.EndTime = this.EndDatePicker.Value.Value.Date.Add(this.EndTimePicker.Value.Value.TimeOfDay);
appointment.Location = this.location.Text;
appointment.IsAllDay = (bool)this.allDay.IsChecked;
appointment.Notes = this.description.Text;
appointment.Reminders = (ObservableCollection<SchedulerReminder>)this.ReminderList.ItemsSource;
appointment.StartTimeZone = this.TimeZoneMenu.Text;
appointment.EndTimeZone = this.TimeZoneMenu.Text;
if (this.Recurrence.Text != "Never")
{
if (this.DailyRecurrenceRepeat.Value != null)
{
SchedulerRecurrenceProperties.RecurrenceCount = (int)this.DailyRecurrenceRepeat.Value;
}
if (this.Repeat.Value != null)
{
SchedulerRecurrenceProperties.Interval = (int)this.Repeat.Value;
}
if (this.DailyRecurrenceUntil.Value >= appointment.StartTime.Date)
{
SchedulerRecurrenceProperties.EndDate = (DateTime)this.DailyRecurrenceUntil.Value;
}
appointment.RecurrenceRule = RecurrenceHelper.CreateRRule(SchedulerRecurrenceProperties, appointment.ActualStartTime, appointment.ActualEndTime);
}
else if (this.Recurrence.Text == "Never")
{
appointment.RecurrenceRule = string.Empty;
}
}
this.Close();
} |
Hi SaiGanesh,
I don't think you have understood my question as the above information isn't relevant.
On the default appointment form, as you have it in the demo you have sent, there is a control to select the recurrence type and then amend the options for that type; See my previous screenshot which highlighted the area on the form in red.
Where is that control in the WPF Library? The blazor library has one, you are using the control (Or at least something to amend the recurrence of the events) on your default form so it must be there.
Lee.
Hi SaiGanesh,
This is dissapointing to hear. Not sure why the Blazor library has this control and the WPF library doesn't.
It would surely be a case of encapsulating the recurrence section from the appointment editor?
Otherwise users have to write their own control for what is a standard rule pattern.
Lee.
Hi Lee,
#Regarding Recurrence Editor Library
As we have mentioned in the previous update, we do not have a separate recurrence library as in the scenario of adding any customized editor for the recurrence editor. You can use the recurrence properties to bind the values in a custom control to the recurrence editor, just like the subject, start, and end time properties are bound to the custom editors.
Regards,
SaiGanesh Sakthivel