CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.88k stars 1.38k forks source link

[Bug] AdvancedCollectionView sorting a WinUI TreeView seems to cancel tree node re-orderings #3262

Open dpaulino opened 4 years ago

dpaulino commented 4 years ago

Describe the bug

When using an AdvancedCollectionView as the item source for a WinUI TreeView, any changes in the node structure of the tree seems to be reversed or canceled by a sort.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Clone this repo: https://github.com/dpaulino/tree-sort-issue
  2. Launch the app
  3. Drag the "hello" node into the "world" node such that "hello" becomes a child of "world"
  4. Click the A-Z sort button.
  5. The tree structure gets reset such that "hello" is no longer a child.

Expected behavior

I expect the sort to:

Screenshots

Video of the bug: https://1drv.ms/v/s!Ar4RhL72OhUDzroWOtjVcYQgEFWGbw?e=kWWWF8

Environment

NuGet Package(s): 
- Microsoft.Toolkit.Uwp.UI 6.0.0
- Microsoft.UI.Xaml 2.3.200213001

Package Version(s): 
- Microsoft.Toolkit.Uwp.UI 6.0.0
Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] Insider Build (build number: 19041.208)

App min and target version:
- [ ] Fall Creators Update (16299)
- [min] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [target] May 2019 Update (18362)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x ] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x ] 2019 (version: 16.5.2) 
- [ ] 2019 Preview (version: )

Additional context

Add any other context about the problem here.

ghost commented 4 years ago

Hello dpaulino, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌