I have a WPF (.Net 4) ListView used to navigate a local Windows directory. It displays the contents of the current directory, with name and size and all that. However, in some directories, the first element it displays shows up twice. For example, let's say in directory "D1" I have subdirectories "W", "X", "Y", and "Z". The ListView will say "W W X Y Z", even though the actual data it's bound to (a ThreadObservableCollection) doesn't have the duplicate. The ThreadObservableCollection is also initially empty when the object that contains it is created, subdirectories and files are found on a background thread and then put in the collection as they are located.
I'm at a loss for how to even debug this, since it's occurring purely in the presentation area, and am worried it may be a bug in the framework itself. It does not occur in every directory, but it seems (somewhat) repeatable in the ones it does occur in which suggests there's some pattern at work here, though I've yet to find any distinguishing characteristics. It's also always the first entry if it does happen.
I have also tried listening to the CollectionChanged event of the ThreadObservableCollection, but it only fires once per item changed as one would expect, and I've watched the values provided to ensure that there are no duplicates (which there aren't).
I also attached a DebugConverter (see below) to the TextBlock containing the name of the (sub)directories shown, and it does show duplicate values. So there are definitely two actual rows in the ListView with the same item behind them, but I still have no idea why.
I'd appreciate any suggestions on what may be going wrong or even how to try to find out why it thinks it has to duplicate the first entry.