Originally posted by Mrcubix July 11, 2023
For some reasons, the selector :nth-last-child(1) seems to only be evaluated properly at first, any additions done after the Window is shown will result in an incorrect behavior.
in this exemple, the last element is supposed to have a margin of 0, so that the scrollbar doesn't show up until another element is added.
the same behavior can be obtained using this repo: https://github.com/Mrcubix/Avalonia-Last-Nth-Child-Selector-Issue
Note that the orginal discussion was written in an earlier version, but the issue is still valid to this day
about the same styling works for ItemsControl, however, ItemsControl suffer from a worse issue explained here #12137
Discussed in AvaloniaUI/Avalonia#12147
Originally posted by Mrcubix July 11, 2023
For some reasons, the selector
:nth-last-child(1)seems to only be evaluated properly at first, any additions done after the Window is shown will result in an incorrect behavior.in this exemple, the last element is supposed to have a margin of 0, so that the scrollbar doesn't show up until another element is added.
the same behavior can be obtained using this repo: https://github.com/Mrcubix/Avalonia-Last-Nth-Child-Selector-Issue
Note that the orginal discussion was written in an earlier version, but the issue is still valid to this day
about the same styling works for
ItemsControl, however,ItemsControlsuffer from a worse issue explained here #12137