Skip to content

TreeViewItem.IsExpanded in WindowsAppSDK 1.6/1.7/1.8 behaves inconsistently when repopulating the TreeView #10309

@usakgb

Description

@usakgb

Describe the bug

When using TreeView's item template and setting TreeViewItem.IsExpanded to True in XAML, repopulating (clearing item and then adding new items) the tree a few times collapses all items.
When binding TreeViewItem.IsExpanded to a read-only property set to True, repopulating the tree randomly collapses/expands the items.
1.5 doesn't have this issue.

Steps to reproduce the bug

A project that demonstrates the bug: https://github.com/usakgb/WinUITreeViewBug

  1. Clone and run the project.
  2. Click Repopulate button a few times.

Expected behavior

All items to be expanded at all times.

Screenshots

Image

NuGet package version

Windows App SDK 1.6.3: 1.6.241114003

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue needs to be triaged by the area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions