Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArgumentOutOfRangeException when adding StatusBarItem #329

Closed
petsuter opened this issue Jun 17, 2016 · 2 comments
Closed

ArgumentOutOfRangeException when adding StatusBarItem #329

petsuter opened this issue Jun 17, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@petsuter
Copy link
Contributor

When MyWindow contains a <Fluent:StatusBar x:Name="statusBar" /> and we do the following:

            var w = new MyWindow();
            w.statusBar.Items.Add(new StatusBarItem());
            w.statusBar.Items.Add(new StatusBarItem());
            w.Show();
            w.statusBar.Items.Add(new StatusBarItem());

(But not with most different variations, e.g. "3xAdd+Show" or "Show+3xAdd" or "Add+Show+2xAdd" all work fine.)

We get an exception:

System.ArgumentOutOfRangeException was unhandled
  HResult=-2146233086
  Message=Insertion index was out of range. Must be non-negative and less than or equal to size.
Parameter name: index
  Source=mscorlib
  ParamName=index
  StackTrace:
       at System.Collections.ArrayList.Insert(Int32 index, Object value)
       at MS.Internal.Controls.InnerItemCollectionView.Insert(Int32 index, Object item)
       at System.Windows.Controls.ItemCollection.Insert(Int32 insertIndex, Object insertItem)
       at Fluent.StatusBar.OnItemsChanged(NotifyCollectionChangedEventArgs e) in C:\projects\fluent-ribbon\Fluent.Ribbon\Controls\StatusBar.cs:line 203
       at System.Windows.Controls.ItemsControl.OnItemCollectionChanged2(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.ItemCollection.OnViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
       at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
       at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at MS.Internal.Controls.InnerItemCollectionView.Add(Object item)
       at System.Windows.Controls.ItemCollection.Add(Object newItem)
       at FluentStatusBarTest.App.OnStartup(StartupEventArgs e) in c:\FluentStatusBarTest\FluentStatusBarTest\App.xaml.cs:line 27

Environment

  • Fluent.Ribbon v4.0.3.394
  • Windows 10
  • .NET Framework 4.5.2
@batzen
Copy link
Member

batzen commented Jun 17, 2016

Could you attach your repro?

@petsuter
Copy link
Contributor Author

@batzen batzen added this to the 5.0.0 milestone Jun 26, 2016
@batzen batzen self-assigned this Jun 26, 2016
@batzen batzen closed this as completed Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants