You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a ItemsRepeater is inside a Viewbox the list of shown items doesn't take the Viewbox transformation into account (or at least not correctly). Not all of the items are drawn even though there is enough space due to the Viewbox.
The viewmodel is simply a ObservableCollection to which strings can be added with via the button:
using System.Collections.ObjectModel;
namespace avalonia_showcase.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
public ObservableCollection<string> Items { get; } = new ObservableCollection<string>();
public MainWindowViewModel()
{
Items.Add("abc");
Items.Add("def");
}
public void Add()
{
Items.Add("test 123");
}
}
}
Expected behavior
Since the whole ItemsRepeater is shrunken down to fit all of its content, I'd expect all of it to be visible.
I think ItemsRepeater is made for being placed inside a scrollviewer. While this still may be a bug, you may want to try ItemsControl instead. I wonder if it has the same bug or not.
ItemsControl and ItemsRepeater both enable customizable collection experiences, but ItemsRepeater supports virtualizing UI layouts, while ItemsControl does not. We recommend using ItemsRepeater instead of ItemsControl, whether its for just presenting a few items from data or building a custom collection control.
When a ItemsRepeater is inside a Viewbox the list of shown items doesn't take the Viewbox transformation into account (or at least not correctly). Not all of the items are drawn even though there is enough space due to the Viewbox.
To Reproduce
Minimal sample:
The viewmodel is simply a
ObservableCollection
to which strings can be added with via the button:Expected behavior
Since the whole ItemsRepeater is shrunken down to fit all of its content, I'd expect all of it to be visible.
Screenshots
Screencast from 2022-10-20 16-57-31 (trimmed).webm
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: