Designer crash after adding certain number of tabs into ribbon

Sep 4, 2009 at 7:26 AM

Create a WPF window application, click XAML to open designer

<Window x:Class="testRibbonTree.Window1"
    Title="Window1" Height="196" Width="266">
    <Grid Name="grid">


between <r:Ribbon> </r:Ribbon>, add <r:RibbonTab Label=tab /> one by one, when add certain number of it, the designer got crash with information below

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Microsoft.Windows.Controls.Ribbon.RibbonTabPanel.CalculateMaxTabWidth(Double clipWidth, Collection`1 tabs)
   at Microsoft.Windows.Controls.Ribbon.RibbonTabPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)


Sep 4, 2009 at 7:27 AM
Edited Sep 4, 2009 at 7:27 AM

The larger ribbon width, the later crash occurs

Sep 4, 2009 at 8:13 PM

Hi cuijiemmx,

We shipped the Ribbon control as is.  Unfortunately, we will not be able to look into this in the near future.  Right now we're heads down on .NET 4.0 and it will take a while until we can devote resources to Ribbon.  Sorry for the inconvenience.


Saied K.

Dec 7, 2009 at 6:18 PM

I am receiving this exact same bug, but in a slightly different context.  I get the same exception whenever I have enough ribbon groups/content in ribbon groups that the content goes beyond the bounds of the ribbon/window that is containing it.  The exception gets thrown as clean-up is occurring on the content.