4

I try to clear an existing ObservableCollection by using a simple Collection.Clear().

It throws:

System.ArgumentOutOfRangeException:
The text associated with this error code could not be found.
Index was out of range. Must be non-negative and less than the size of the collection.

This collection is associated with a ComboxBox in a Flyout I just hide before trying to clear. What else should I do?

Peter B
  • 22,460
  • 5
  • 32
  • 69
Pierresa
  • 89
  • 5

1 Answers1

1

as canton7 suggested my collection was still being used in the Flyout (hiding the flyout is in fact not enough to close/release). The fix is simply to assign/deassign collection to ComboBox.

Pierresa
  • 89
  • 5