-
Notifications
You must be signed in to change notification settings - Fork 721
Bug: Wrapping ListViewItemPresenter into Grid within a ControlTemplate throws an exception #6562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I suspect ListViewItemPresenter assumes in code that its parent will be a ListViewItem. What does wrapping the LVIP afford you? @RBrid could maybe confirm my suspicions. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
@StephenLPeters Thank you. I was looking for ways to solve this issue: #6560 What am I loosing from ListViewItemPresenter functionality, if I were to replace it by generic ContentPresenter? I read LVIP implements some ListView related optimizations, but didn't find any specifics. |
@ksmutny You are not going to be able to put a grid between ListViewItem and ListViewItemPresenter. However you should able to place the grid within the ListViewItemPresenter to achieve the customizations you need. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Describe the bug
Trying to customize a presentation of a
ListViewItem
through customizing aControlTemplate
usingListViewItemPresenter
within another container, e.g.Grid
orStackPanel
. When using genericContentPresenter
, the code works as expected, but withListViewItemPresenter
, it throws an exception.Steps to reproduce the bug
The following code throws an Unhandled exception at 0x79FF7FD9 (Microsoft.ui.xaml.dll) in test.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x15BCFFB8, 0x00000004).
Expected behavior
I expect the code to work. When
<ListViewItemPresenter/>
is replaced with a generic<ContentPresenter/>
, no exception is thrown and the code works as expected. (Without all the goodies ofListViewItemPresenter
, of course).Is there any reason why
ListViewItemPresenter
throws an exception and cannot be used this way, or is it a bug?Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.0 (If you're seeing your issue in older previews of WinUI 3, please try this release)
Windows app type
Device form factor
Desktop
Windows version
Insider Build (xxxxx)
Additional context
Windows 11 Pro version 22000.376
The text was updated successfully, but these errors were encountered: