Uwp.CoverFlowSample icon indicating copy to clipboard operation
Uwp.CoverFlowSample copied to clipboard

Possible bug: control always sets SelectedIndex the first time

Open GeertvanHorrik opened this issue 9 years ago • 0 comments

I am trying this control for a media player, and I found a possible issue:

In PrepareContainerForItemOverride:

            if (items.Count == 1)
            {
                IndexSelected(0, false);
            }

But the first time an item is generated, the count is always 1. I think it's better to check the count of the ItemsSource (which already has the right count).

A fix that works on my machine is:

            var itemsSource = ItemsSource as ICollection;
            if (itemsSource != null && itemsSource.Count == 1)
            {
                IndexSelected(0, false);
            }

GeertvanHorrik avatar Mar 15 '16 11:03 GeertvanHorrik