uno
uno copied to clipboard
`ItemsStackPanel` not playing well with `ItemsControl`
Current behavior
On Desktop the items are overlaying each other. On Android the ItemsControl doesn't show anything. On WASM nothing is displayed, not even the TextBlock.
Code
<TextBlock Text="ItemsControl" FontSize="20" Margin="10" />
<ItemsControl ItemsSource="{Binding SampleData}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
public class MainViewModel
{
public List<string> SampleData { get; set; }
public MainViewModel()
{
SampleData = new List<string>
{
"Item 1",
"Item 2",
"Item 3",
};
}
}
Desktop
Android
WASM
Doesn't show anything at all
Expected behavior
Windows
How to reproduce it (as minimally and precisely as possible)
Repro app -> UnoApp8.zip
Workaround
Use StackPanel instead of ItemsStackPanel.
Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
"Uno.Sdk": "5.2.108"
<UnoExtensionsVersion>4.1.14</UnoExtensionsVersion>
<UnoToolkitVersion>6.0.18</UnoToolkitVersion>
<UnoThemesVersion>5.0.13</UnoThemesVersion>
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
If I use ListView instead of ItemsControl it works everywhere, but Android doesn't.
If I use StackPanel instead of ItemsStackPanel it works everywhere.
cc @dr1rrb, @MartinZikmund, @jeromelaban
@eriklimakc is this a blocker for a project or a solution please?
@eriklimakc is this a blocker for a project or a solution please?
No, not a blocker at the moment.
cc @agneszitte