[c#]
AppointmentStyle appointmentStyle = new AppointmentStyle();
appointmentStyle.TextColor = Color.Black;
schedule. AppointmentStyle = appointmentStyle;
|
Is there any way to change the text color of the individuals ScheduleAppointment?
There is a ScheduleAppointmtent.Color property which modify the background color,
But let's say that, for some reason, I want a type of appointment black and another type white.
Can I have the black appointments with white text and the white appointments with black text, or is this not currently possible?
You can only change the color for ALL appointments? Why can't you change it on each individual appointment?
[c#]
schedule.OnAppointmentLoadedEvent += Schedule_OnAppointmentLoadedEvent;
… void Schedule_OnAppointmentLoadedEvent(object sender, AppointmentLoadedEventArgs e) { var appointment = (e.appointment as ScheduleAppointment); AppointmentStyle appointmentStyle = new AppointmentStyle(); if (appointment.Subject == "Meeting") appointmentStyle.TextColor = Color.Red; else if (appointment.Subject == "Break") appointmentStyle.TextColor = Color.Green; e.appointment = appointmentStyle; } |
Hi Syncfus,Yes, you can change the specific appointment TextColor using OnAppointmentLoadedEvent of Schedule in Xamarin Forms. Please refer the below code example,
[c#]schedule.OnAppointmentLoadedEvent += Schedule_OnAppointmentLoadedEvent;
…
void Schedule_OnAppointmentLoadedEvent(object sender, AppointmentLoadedEventArgs e)
{
var appointment = (e.appointment as ScheduleAppointment);
AppointmentStyle appointmentStyle = new AppointmentStyle();
if (appointment.Subject == "Meeting")
appointmentStyle.TextColor = Color.Red;
else if (appointment.Subject == "Break")
appointmentStyle.TextColor = Color.Green;
e.appointment = appointmentStyle;
}ScheduleAppointment has default “Color” property to set background Color to the appointment, please refer our online user guide documentation for the same.Please let us know if you have any query on this.Regards.
Subburaj Pandian V
Hi,
I have done below approach to customize appointments. But it's not affecting to the all day appointments. All day appointments are showing in scheduler without taking any added styles.I realized not firing appointment_loadedevent for all day appointments. Do I needs to add set any other things for that?
Please help me on this.
Thanks