Skip to content

Item Repeater WrapLayout Throws #24

@MohamedElhamzawy1993

Description

@MohamedElhamzawy1993

Describe the bug

I have a grid of 2 columns and a grid splitter. The second column has an item repeater of borders. When resizing with the grid splitter the app throws a null exception.
ItemRepeaterBug.zip

To Reproduce

`

	<!-- GridSplitter for resizing -->
	<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Center" VerticalAlignment="Stretch" />

	<!-- ItemsRepeater in the Second Column -->
	<ItemsRepeater Name="ItemsRepeater" ItemsSource="{Binding Skills}" Grid.Column="2">
		<ItemsRepeater.Layout>
			<WrapLayout
				Orientation="Horizontal"
				VerticalSpacing="15"
				HorizontalSpacing="15" />
		</ItemsRepeater.Layout>
		<ItemsRepeater.ItemTemplate>
			<DataTemplate>
				<Border BorderBrush="Black"
						BorderThickness="2"
						Background="{DynamicResource ArWhite}"
						Height="80"
						Width="70">
				</Border>
			</DataTemplate>
		</ItemsRepeater.ItemTemplate>
	</ItemsRepeater>
</Grid>`
` public partial class MainViewModel : ViewModelBase
        {
            public ObservableCollection<int> Skills { get; } = new ObservableCollection<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
        }`

Expected behavior

No response

Avalonia version

11.0.10

OS

Windows

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions