Replies: 3 comments 1 reply
-
I guess the issue might be that zomming in / out does not trigger a layout pass and thus the bounds of canvas is not re-calculated. If you set a certain width / heihgt to your ItemsControl, does it help? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I added this code to try to invalidate the window. But it did not do the trick :(
|
Beta Was this translation helpful? Give feedback.
0 replies
-
ping @wieslawsoltes |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to implement a canvas with a lot of elements on it that can be zoomed. For that I used the pan and zoom package: https://www.nuget.org/packages/Avalonia.Controls.PanAndZoom. But I run into the problem that controls initially outside the canvas are not included when paning or zooming. What I dont get is that the issue is only for ItemsControl. If I place a number of buttons manually on a canvas, buttons outside the normal view will appear when I zoom out. Also, if I use a StackPanel everything works just fine. So the issue is quite localized to using the ItemsControl.
What am I missing? Or could there be something wrong in Pan and Zoom package?
Illustration of the issue.
As I zoom out. The buttons initially outside the view are not included. When resizing the window they do appear.

Code
My view is very simple and looks like:
And the DataViewModel and related classes:
Beta Was this translation helpful? Give feedback.
All reactions