How can we improve the Windows dev platform?

Some children are not shown in stack panel

Here's a minimal Github Repo I created to reproduce the problem.

*******

I have a listview whose items panel is set to StackPanel since I need to set the group style panel to a staggered panel which doesn't work well with item stack panel.

The problem now is, out of 27 groups, only 16 groups are shown. I tested it on another list view and I confirmed that the problem is that the stack panel only displays a limited number of children (the strange thing is it's not 16 on my test but 22).

I tried VirtualizingStackPanel but unlike StackPanel, I can't seem to center it inside the list view upon setting its MaxWidth though it displays all its children.

Here's my XAML:

<ListView ItemsSource="{Binding Source={StaticResource NoteViewSource}}"
Padding="0 0"
ItemTemplate="{StaticResource NormalNoteTemplate}"
x:Name="ListView"
IsItemClickEnabled="True"
ItemClick="ListView_OnItemClick"
SelectionChanged="ListView_OnSelectionChanged"
SelectionMode="Extended">
<ListView.Footer>
<Border Height="80" />
</ListView.Footer>
<ListView.GroupStyle>
<GroupStyle HidesIfEmpty="False">
<GroupStyle.HeaderTemplate>
<DataTemplate x:DataType="viewModels:NoteList">
<TextBlock Text="{x:Bind Header, Mode=OneWay}"
FontSize="18"
Margin="0,16,0,8"
FontWeight="Bold" />
</DataTemplate>
</GroupStyle.HeaderTemplate>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<uwp:SGStaggeredPanel DesiredColumnWidth="220"/>
</ItemsPanelTemplate>
</GroupStyle.Panel>
</GroupStyle>
</ListView.GroupStyle>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<!-- custom group panel won't work if this is item panel-->
<StackPanel />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>Edit:

I inspected it further and it seems that the StackPanel is not the problem since its Children count is 22. This means it has the wrong count of children which means the problem is in the CollectionViewSource or the ListView passing only 22 items in the StackPanel rather than the full count.

But what I can't understand is why does the VirtualizingStackPanel work??

1 vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base