[Improvement] `ListBox.draggable`-Style should not disable virtualization
See original GitHub issuefirst of all this library is really really useful and I am happy with the state it is. 😄 However when I tested some performance in my App and I noticed that adding several hundred or thousand items to a ListBox.draggable
makes the UI nearly unusable. After having a deeper look I noticed that virtualization is disabled in the Styles
-Section:
<Style Selector=":is(ListBox).draggable">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
If I replace the StackPanel
with VirtualizingStackPanel
it works, but dragging an item and scrolling is buggy (I think this is the reason for disabling virtualization?)
I know that I can add my own logic which I already do (I use adorner instead of transforms) but maybe others will face the same issue also, that is why I decided to open this ticket here. If I find a good solution I’ll open a PR for this.
Happy coding Tim
Issue Analytics
- State:
- Created 2 years ago
- Comments:14
Top GitHub Comments
@timunie Thanks for repro. I am working on fix and other improvements here https://github.com/wieslawsoltes/AvaloniaBehaviors/pull/85
Yes, maybe that is a good idea to do. I have to learn more about this
I think the scrolling needs to be handled also in some way as the
RenderTransform
needs to be adjusted accordingly.