Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

ListDetailsView not working with WinUI3/WindowsAppSDK 1.0.0-preview3 #4357

Closed

Description

@huoyaoyuan

Describe the bug

ListDetailsView causes hard crash in normal usage.

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
    7.0.1

Steps to Reproduce

  • Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)

Steps to reproduce the behavior:

  1. Create a WinUI3/WAS project, install toolkit 7.1.1-preview3
  2. Add a ListDetailsView, set ListPaneWidth and some content
  3. if ListPaneWidth set in xaml, it will fail with XamlParseException which wrappes NullReferenceException
    4. When moving mouse over the control. it will fail with not being able to load reveal brush
    Edit: I used reveal brush in my custom style. It's not caused by the control itself.

Environment

NuGet Package(s):
CommunityToolkit.WinUI.UI.Controls.Layout
Microsoft.WindowsAppSDK 1.0.0-preview3

Package Version(s):
7.1.1-preview3

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19043)
  • Insider Build ({build_number})

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build ({build_number})

Device form factor:

  • Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio version:

  • 2017 (15.{minor_version})
  • 2019 (16.{minor_version})
  • 2022 (17.{minor_version})

Additional context

This could be a issue of WinUI side, but we should be aware of them here.

Activity

  1. added
    bug 🐛An unexpected issue that highlights incorrect behavior
    on Nov 1, 2021
  2. changed the title [-]ListDetailsView broken with WinUI3/WindowsAppSDK 1.0.0-preview3[/-] [+]ListDetailsView.ListPaneWidth broken with WinUI3/WindowsAppSDK 1.0.0-preview3[/+] on Nov 3, 2021
  3. changed the title [-]ListDetailsView.ListPaneWidth broken with WinUI3/WindowsAppSDK 1.0.0-preview3[/-] [+]ListDetailsView not working with WinUI3/WindowsAppSDK 1.0.0-preview3[/+] on Nov 3, 2021
  4. huoyaoyuan commented on Nov 3, 2021

    @huoyaoyuan
    ContributorAuthor

    The call stack is native SystemNavigationManager::GetForCurrentView, so this is microsoft/microsoft-ui-xaml#4174 again.

  5. michael-hawker commented on Nov 4, 2021

    @michael-hawker
    Member

    Thanks @huoyaoyuan I think we missed from the original WinUI discussion that there was code we needed to update here too. Thanks for filing an issue.

    @azchohfi looks like we missed how best to convert these APIs here:

    if (Window.Current != null)
    {
    SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;
    }

    if (Window.Current != null)
    {
    SystemNavigationManager.GetForCurrentView().BackRequested -= OnBackRequested;
    }

    According to the docs this isn't a WinUI 3 API at all. We used it here to synchronize the behavior of the ListDetailsView to the main app back button. Since that concept doesn't exist, I think we just remove this code entirely in our WinUI 3 world, right?

    I think our original hope was that Window.Current was going to be a guard for this, or am I mis-remembering?

  6. added
    WinUI 💠Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3.
    and removed on Nov 4, 2021
  7. added this to the WinUI3 milestone on Nov 4, 2021
  8. huoyaoyuan commented on Nov 5, 2021

    @huoyaoyuan
    ContributorAuthor

    Since that concept doesn't exist, I think we just remove this code entirely in our WinUI 3 world, right?

    How about WinUI 3 with UWP? On Win32 I think we can remove it.

  9. michael-hawker commented on Nov 9, 2021

    @michael-hawker
    Member

    @huoyaoyuan sorry are you creating a WinUI 3 UWP project? We only support WinUI 3 Desktop projects with the Toolkit.

  10. michael-hawker commented on Nov 9, 2021

    @michael-hawker
    Member
  11. added a commit that references this issue on Nov 9, 2021
    6df772b
  12. 5 remaining items

  13. modified the milestones: WinUI3, 7.1.3 on Aug 23, 2022
  14. michael-hawker commented on Aug 25, 2022

    @michael-hawker
    Member

    Was able to reproduce this in UWP as well, so not specific to WinUI 3. It was overlooked with the change to TwoPaneView for this component in PR #3768, so setting ListPaneWidth before loading is just broken due to lack of null check in OnListPaneWidthChanged, fix should be:

            private void OnListPaneWidthChanged()
            {
                if (_twoPaneView != null)
                {
                    _twoPaneView.Pane1Length = new GridLength(ListPaneWidth);
                }
            }
  15. LalithaNadimpalli commented on Aug 26, 2022

    @LalithaNadimpalli
    Contributor

    Hi, Thank you for raising the Issue, Created a PR with the suggested changes

  16. Repository owner moved this from In Progress to Done in Windows Community Toolkiton Sep 2, 2022
  17. ghost locked as resolved and limited conversation to collaborators on Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Completed 🔥WinUI 💠Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3.bug 🐛An unexpected issue that highlights incorrect behaviorcontrols 🎛️

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions