Silverlight Toolkit Accordion Control: Layout Error Code 4008

So after much banging our heads against the wall we discovered that because our root visual was a ScrollViewer that contained a Content Control which we use to swap content in and out of we ran into this Layout Error Code due to a race condition within the ScrollViewer and the contained content.

Lesson Learned: Don’t but an Accordion Control into a ScrollViewer.


One thought on “Silverlight Toolkit Accordion Control: Layout Error Code 4008

  1. Make sure when adding an AccordingItem, the IsSelected property is set to false.
    If you want to have it selected, do the above and add the following
    accordionItem.Loaded += new RoutedEventHandler(accordionItem_Loaded);
    void accordionItem_Loaded(object sender, RoutedEventArgs e)
    var accordionItem = sender as AccordionItem;
    accordionItem.IsSelected = true;


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s