Appointments in week view


In the outlook scheduler if you create appointments for one day in specific it works, but if you switch to the week view the appointment is not shown for that day.


Eswaramoorthi wrote Oct 9, 2012 at 2:14 PM


I created the Appointments from Day View/ any view but it didn't reflected in the Week view and the Appointment item is saved in the AppointmentsOptions.xml.

As mentioned by Narat in the other Thread the calculation of X values done in ArrangeOverride() function in AppointmentItemsPanel.cs is giving the size which is out of visible area, due to which the Appointments are not displayed in the Week View except the First Day of the Week i.e. either Sunday/Monday.

The above code i Checked and didn't resolve the issue.

So i took the X values calculation from AppointmentItemsExtPanel.cs and it solved the issue and now the Week View is working fine.

Solution :

ArrangeOverride() in AppointmentItemsPanel.cs has been modified like below

protected override Size ArrangeOverride(Size finalSize)


for (int i = 0; i < this.Children.Count; i++)


double y = 0;

double x = 0;

Size ChildSize = new Size();

UIElement child = (UIElement)this.Children[i];

if (child.GetType() == typeof(ucAppointment))


ucAppointment item = (ucAppointment)child;

int count = 1;

int position = 0;

CalculateItemsInSlot(item, out count, out position);

ChildSize = CalculateHeightWidth(finalSize, (AppointmentVM)item.DataContext, count);

x = CalendarViewModel.TimeSlotWidth;

switch (CalendarViewModel.CurrentDateView)


case DateView.Day:

x += ChildSize.Width * position;


case DateView.WorkWeek:

case DateView.FullWeek:

  • Modified Start - Copy the X value Calculation from AppointmentItemsExtPanel.cs
  • Copy the CalculateX() function also from AppointmentItemsExtPanel.cs

// x += CalculateX((AppointmentVM)item.DataContext, finalSize.Width, count, position);

x += CalculateX((AppointmentVM)item.DataContext, finalSize.Width);

/Modified End - Copy the X value Calculation from AppointmentItemsExtPanel.cs /



y = CalculateY((AppointmentVM)item.DataContext);


child.Arrange(new Rect(x, y, ChildSize.Width, ChildSize.Height));


return base.ArrangeOverride(finalSize);


CalculateX() has been copied as it is from AppointmentItemsExtPanel.cs.

private double CalculateX(AppointmentVM vm, double width)


DateTime _MondaysDate = CalendarViewModel.CurrentDate.AddDays((int)System.DayOfWeek.Monday - (int)CalendarViewModel.CurrentDate.DayOfWeek);

long DateDiff = FunctionExtensions.DateDiff(DateInterval.Day, _MondaysDate.Date, vm.StartDate.Date);

if (CalendarViewModel.CurrentDateView == DateView.FullWeek)

DateDiff += 1;

return (double)DateDiff * CalendarViewModel.DayItemWidth;


I hope this helps.

wrote Feb 14, 2013 at 2:16 AM