|
void Schedule_AppointmentLoaded(object sender, AppointmentLoadedEventArgs e)
{ //UI Bounds of an appointment. var appointmentBounds = e.Bounds; FrameLayout frameLayout = new FrameLayout(this); frameLayout.SetBackgroundColor(Color.Red); TextView monthCellText = new TextView(this); monthCellText.SetBackgroundColor(Color.Red); monthCellText.Text = e.Appointment.Subject; monthCellText.SetTextColor(Color.White); monthCellText.TextSize = (14); monthCellText.SetPadding(8, 60, 0, 0); ImageView imageView = new ImageView(this); imageView.SetPadding(8, 0, 0, 0); frameLayout.AddView(monthCellText); if (monthCellText.Text == "B'Day Party") { imageView.SetImageResource(Resource.Drawable.BirthDate); } else if(monthCellText.Text == "Health Checkup") { imageView.SetImageResource(Resource.Drawable.hospital); } LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(46, 60); imageView.LayoutParameters = (layoutParams); frameLayout.AddView(imageView); e.View = frameLayout; } |
Hi Swathi,
thanks, it's working like a charm! One thing I've noticed though is that the event handler doesn't seem to be called for all-day appointments. Is there any way to style those, too?
Olaf