Replies: 3 comments 4 replies
-
Hi , Do you think you are able to send a PR which fixes your issue? Maybe this can help to speed up things. I can't promise as I am not a core member, but I got my issues fixed that way. As a workaround, consider to set MaxHeight to your ScrollViewer. Or the root Grid. Happy coding |
Beta Was this translation helpful? Give feedback.
-
Do you have some code to share? This might help a lot. |
Beta Was this translation helpful? Give feedback.
-
Finally, i was able to fix the problem. It was so simple that i wonder why this bug was here since ever and never got any serious attention... PR: #8093 |
Beta Was this translation helpful? Give feedback.
-
I need to trigger a full window redraw, similar to what happens when user manual resize the window by the borders.
Reason: Avalonia window AutoSize with MaxWidth/Height is bugged since ever (elements will strech to infinity never respecting the set window MaxSize) unless user manual resize the window so control will constrain correctly. I open some issues but no fix: #6441 #5466 #4789
In a UI framework a bug like this is kinda sloppy. This should take serious review and proper fix! I understand that a autosize will strech to infinity up to the content but when MaxWidth/Height is set it should be respected no matter of the mode, it already do when user resize window, why not doing it on constructor/render too? I know this is caused by
Window.Width and Height = NaN
but it should be looking at bounds and compare to MaxWidth/Height before draw the elements.So to be able to deliver a fix on my app i do many hacks like, set to manual, resize window, set position, set again to autosize, etc. Which is a pain and not optimal.
However if user resize window by by px amout it will fix all the view! So how can i trigger a full redraw of window to produce same effect? I tried all
Invalidate*
methods, none works to produce the same effect as a manual resize would do.Window.MaxWidth and MaxHeight is factorized to
screen resolution / 2
, produces:Now if user resize window by any value it fix the problem:
This is what i want to trigger by code on
OnLoaded
Note, the following code doesn't work for the same porpouse (Not equal to user manual resize) and content will still be overflowing:
The downside of doing a resize to fix this problem is that AutoSize mode is lost, since now window will have fixed size and no longer adjust to content. And windows startup position will be invalidated too if we change the window size. That's why this need a proper fix.
Beta Was this translation helpful? Give feedback.
All reactions