New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VirtualizingStackPanel render only first item #12432
Comments
@Meloman19 I think LayouTransform is what you need. Render transform will not have enough information about transformed bounds. https://docs.avaloniaui.net/docs/next/reference/controls/layouttransformcontrol#more-information |
@timunie Yes, LayoutTransform is works, but losing the benefit of RenderTransform. As I can see from the source code, RenderTransform used on bounds transform. But main problem in EffectiveViewport. When panel is out of bounds, value of calculated viewport becomes empty and VirtualizedStackPanel prepare only one entity. And after change render position not raised EffectiveViewport event, because it's part of layout pass. Instead of using an EffectiveViewport event, VirtualizingPanel can use directly parent IScrollable interface. But in this case invalidating event is missing. Or move EffectiveViewport to render pass... |
I guess this is by design, but will ask @grokys first |
Yeah, not sure how to fix this. You've correctly diagnosed it I think: the listbox that is being transitioned in is arranged outside the effective viewport of the containing control, so the control believes that it doesn't need to realize any items; not knowing that it's going to be transitioned into view by a render transform. Your suggestions for solving it have a few problems:
I think some sort of hint where a transition can communicate to the virtualizing items control that it's being transitioned might be the best solution, but we'd need to think about how that would work. Alternatively we could just ignore render transforms when calculating the viewport for items controls. |
Describe the bug
VirtualizingStackPanel render only first item when move from out of bounds with rendertransform.
To Reproduce
2. On MainView.axaml insert:
3. MainView code-behind:
4. ItemsControlTheme:
Expected behavior
All items from ItemsControls are rendered
Screenshots
2023-08-04.04-54-29.mp4
Desktop (please complete the following information):
Additional context
VirtualizingStackPanel render other items when visual is invalidated. For example, button change state from
pointerover
tonormal
or window resized etc. Also all right if use StackPanel instead VirtualizingStackPanel.The text was updated successfully, but these errors were encountered: