This is a migrated thread and some comments may be shown as answers.

UpdateLayout not working

0 Answers 86 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Ronald
Top achievements
Rank 1
Ronald asked on 21 Aug 2012, 10:02 AM
Hi,

in scheduleview I am do following:
- every time the visible range is changed I set the AppointmentsSource = null. After that I add some new Appointments (which fit into the visible range). After that I call UpdateLayout().

            scheduleView.BeginInit();
            scheduleView.AppointmentsSource = null;
            scheduleView.AppointmentsSource = observableAppointments;
            scheduleView.EndInit();
            scheduleView.UpdateLayout();

This is ok, when I click the back and forward buttons on schedule view. But when I change from Week View into Day View, I get an exception. I debugged schedule view and got the exception in AppointmentsPanel.cs in

private void UpdateMaxDesiredSize(GroupHeader header, bool isHorizontal)
        {
            header.Measure(infinity);

            int level = header.Level;
            Size desiredSize = header.DesiredSize;
            int adjustLevel = level - 1;

            double levelMaxDesiredLength = this.GetMaxDesiredLength(adjustLevel);

            double length;
            if (isHorizontal)
            {
                length = header.DesiredSize.Width - header.BorderThickness.Right;
            }
            else
            {
                length = header.DesiredSize.Height - header.BorderThickness.Bottom;
            }
            levelMaxDesiredLength = Math.Max(levelMaxDesiredLength, length);
            this.headerMaxLengthLevels[adjustLevel] = levelMaxDesiredLength;  Here headerMaxLengthLevels has zero entries.
        }


What's the reason for this?

Regards,
Ronald

No answers yet. Maybe you can help?

Tags
ScheduleView
Asked by
Ronald
Top achievements
Rank 1
Share this question
or