You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
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
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:
Create a WinUI3/WAS project, install toolkit 7.1.1-preview3
Add a ListDetailsView, set ListPaneWidth and some content
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.
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
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
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?
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:
Activity
[-]ListDetailsView broken with WinUI3/WindowsAppSDK 1.0.0-preview3[/-][+]ListDetailsView.ListPaneWidth broken with WinUI3/WindowsAppSDK 1.0.0-preview3[/+][-]ListDetailsView.ListPaneWidth broken with WinUI3/WindowsAppSDK 1.0.0-preview3[/-][+]ListDetailsView not working with WinUI3/WindowsAppSDK 1.0.0-preview3[/+]huoyaoyuan commentedon Nov 3, 2021
The call stack is native SystemNavigationManager::GetForCurrentView, so this is microsoft/microsoft-ui-xaml#4174 again.
michael-hawker commentedon Nov 4, 2021
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:
WindowsCommunityToolkit/CommunityToolkit.WinUI.UI.Controls.Layout/ListDetailsView/ListDetailsView.cs
Lines 173 to 176 in 82e2bbb
WindowsCommunityToolkit/CommunityToolkit.WinUI.UI.Controls.Layout/ListDetailsView/ListDetailsView.cs
Lines 196 to 199 in 82e2bbb
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.Currentwas going to be a guard for this, or am I mis-remembering?huoyaoyuan commentedon Nov 5, 2021
How about WinUI 3 with UWP? On Win32 I think we can remove it.
michael-hawker commentedon Nov 9, 2021
@huoyaoyuan sorry are you creating a WinUI 3 UWP project? We only support WinUI 3 Desktop projects with the Toolkit.
michael-hawker commentedon Nov 9, 2021
Ah, we found some unguarded cases in https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/main/Microsoft.Toolkit.Uwp.UI.Controls.Layout/ListDetailsView/ListDetailsView.BackButton.cs, so those may be it as well. We're adding guards :)
Added guard for SystemNavigationManager. Fixes #4357
5 remaining items
michael-hawker commentedon Aug 25, 2022
Was able to reproduce this in UWP as well, so not specific to WinUI 3. It was overlooked with the change to
TwoPaneViewfor this component in PR #3768, so settingListPaneWidthbefore loading is just broken due to lack ofnullcheck inOnListPaneWidthChanged, fix should be:LalithaNadimpalli commentedon Aug 26, 2022
Hi, Thank you for raising the Issue, Created a PR with the suggested changes