Skip to content

ReorderListBox bugs out when ScrollViewer is active #15

@avsomeren

Description

@avsomeren

Whenever a listbox contains more items than it can handle, by default it will display a scrollviewer.
The reordering will stop to function properly when this happens.

The first thing i notice is that because of the standard virtualisation of the ItemsPanel, Transform item breaks because the item with an index higher than the ones visible will return null at ItemContainerGenerator.ContainerFromIndex(i) as FrameworkElement. This however is easily fixed by declaratively implementing a non virtualized ItemsPanel.

Second, the position of the overlay adorner is not updated when scrolling occurs. The adorner scrolls with the content of the ListBox and thus moves up or down.

The behaviour is easily reproduced by setting a ListBox height to 120 in the demo app.

Any clues on how to fix the second issue/observation?

Regards,
avsomeren

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions