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;
    }

    Like

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s