locked
Error when resizing window at point where TabItem wraps to second line... RRS feed

  • Question

  • In my app I have a TabControl which contains several tabs.  When I change the size of the window (smaller obviously) right at the point where the TabItems would wrap onto a second line I get an error:

    Sys.InvalidOperationException:

    ManagedRuntimeError #4004 in control 'slWin':

    System.ArgumentException: Value does not fall within the expected range.
      at System.Windows.Size.set_Width(Double value)
      at System.Windows.Controls.Primitives.TabPanel.ArrangeHorizontal(Size...

    1) I thought at first that I may be causing this problem with something I had done in my styles so I removed all the the styling and the problem still occurs. 
    2) Next, I began to look at the TabItem's themselves and noticed that my ItemSource property was bound to an ObservableCollection<SubTab>.  When creating this collection, I add several objects, all of which are either <SubTab> or derived from <SubTab>.  Could this be part of my problem?

    Has anybody else come across a TabControl resizing issue?



    Monday, July 27, 2009 1:11 PM

Answers

All replies

  • I believe I have found the source of this problem and have reposted it in the bugs forum with a simple project to illustrate the issue more clearly.

     http://silverlight.net/forums/t/115217.aspx

    Wednesday, July 29, 2009 10:16 AM
  • I'm having the same problem and tried find the example you posted, but the link doesn't work.  is there another link or can you please explain it to me?

    Thank you.

    Monday, March 24, 2014 3:05 AM
  • Hello, I have been having this issue also, however I may have just found a solution.

    After trying to resolve this for many hours, I thought I would hide the control with the visibility.Collapsed. Then when the page has fully loaded, reveal the control. This has solved the error for myself and hopefully will help.

    Thanks

    Wednesday, December 20, 2017 9:45 AM