Skip to content

feat(gridview)!: Use the item presenter in the default style - #25925

Closed
MartinZikmund wants to merge 118 commits into
dev/mazi/listviewitempresenterfrom
dev/mazi/gridview-presenter-default
Closed

MartinZikmund wants to merge 118 commits into
dev/mazi/listviewitempresenterfrom
dev/mazi/gridview-presenter-default

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: closes #17231

PR Type:

✨ Feature

What changed? 🚀

Makes WinUI's presenter-based DefaultGridViewItemStyle the implicit GridViewItem style again, so default GridView items render through the ListViewItemPresenter chrome, as in WinUI (GridViewItem_themeresources.xaml). This is the GridView half of #25389, split out at review request so GridView doesn't switch before its perf work lands.

Important

Stacked on #25389. Merge only after all of these are merged:

Before merging, re-run the GridView perf harness on master plus this PR alone. #25389 has the stacked table; even stacked, multi-select and step scroll were still slower than master.

Changes:

To do before merge (from the #25389 review): add a GridView screenshot test showing a selected item and the multi-select check box.

PR Checklist ✅

Breaking changes (in the 7.0 migration guide):

  • The default GridViewItem template changes. The Fluent GridViewItemExpanded is removed, so {StaticResource GridViewItemExpanded} resolves to the older non-Fluent copy in Generic.xaml.
  • GridViewItem defaults to AllowDrop="True", as in WinUI. Over the middle of an item, the item marks DragOver handled, so plain DragOver handlers on the GridView don't run there, and built-in reordering only happens over the item's edge zones.

Validation: Runtime, Skia Desktop (Win32, Release, net11.0-desktop): Given_GridViewItemPresenter 28/28 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT

MartinZikmund and others added 30 commits October 27, 2026 15:39
WinUI's ListViewBaseItem applies the full visual state list, so the
Uno-only cap assertion would fail on the native head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
An RTL flip or a Projection creates a NativeRenderTransformAdapter
without a RenderTransform; assigning RenderTransform afterwards
disposed it and threw a NullReferenceException.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
Port CTransitionTarget: its transform composes between RenderTransform
and the RTL flip, its opacity multiplies UIElement.Opacity, and its
sticky element-bounds clip is a separate Visual.TransitionClip that
rendering, culling and hit testing intersect with the other clips.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
Timelines flagged IsThemeGenerated begin without the dispatcher hop,
write their t=0 value during Begin, and only write or clear the target
while they own it (CAnimation::TakeControlOfTarget), so Begin-new then
Stop-old hands off the current value instead of snapping to base.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
Ownership registration now remembers the (target, property) it was made
on, so a retarget or Stop removes the right entry (animation.cpp:475-494,
830-841). Flagged keyframes write their t=0 value before starting the
animator, since a zero-duration animator completes inside Start. Empty
flagged timelines still take control, and natural FillBehavior.Stop
completion releases it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
Zero-duration completion (HoldEnd and Stop), a superseded timeline that
keeps ticking, and a retarget that must drop the old registration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
Add ListViewBaseItem, ListViewBaseItemPresenter and
ListViewBaseItemTemplateSettings as public abstract bases with
internal ctors (hidden from IDL in WinUI, public here because their
subclasses are public). ListViewItem/GridViewItem, the presenters and
the template settings now derive from them.

DragItemsCount lives on the template settings base: public getter,
internal setter. The sync generator skips the base clause for the six
derived types.

Public API change: ListViewItemTemplateSettings and
GridViewItemTemplateSettings lose their public parameterless ctor
(internal, as in WinUI); PackageDiffIgnore entries added. Base types
of the six derived types change (binary compatible).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
Match XamlOM: the hidden ListViewBaseItemTemplateSettings base has no
members, and ListViewItemTemplateSettings / GridViewItemTemplateSettings
each declare their own DragItemsCount (public get, internal set, private
DP owned by the concrete type). Keeps the public getter on both types,
so PackageDiff sees no member removal.

Also add the internal ListViewBaseItem.IsDraggable DP declared in the
same XamlOM block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
A type with more than 15 cached DPs overflowed the uint flag enum
(1 << 31 is a negative int constant), failing with CS0031.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
Declare the 59 presenter DPs, serve the theme-dependent defaults
through GetDefaultValue2 and forward the deprecated aliases to
ContentPresenter, as WinUI does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
The deprecated presenter aliases now write ContentPresenter.Padding and
the content alignments at the alias' precedence instead of Local, so a
Style setter on the alias no longer overrides a local target value
(ListViewBaseItemChrome.cpp:4952-4990). Also corrects the Deny quirk
comment and wires the constant defaults to the chrome getters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N5EeNWm4nEVPukCtv78fhd
MartinZikmund and others added 10 commits November 2, 2026 09:32
GridView stays on GridViewItemExpanded until its perf PRs (#25403, #25404, #25406, #25409, #25411, #25413) land. Apps opt into WinUI's chrome with DefaultGridViewItemStyle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
InvalidateRender now marks the layers dirty, as WinUI's NWSetContentDirty
does, and the next arrange rebuilds them once, or when the size changes.
ChangeVisualState reads the cached rounded-chrome value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
DragBackground, DragForeground, DragOpacity, FocusBorderBrush and
FocusSecondaryBorderBrush have no reader while the drag visual and focus
rectangle are parked. ListViewItem.TemplateSettings is live now that
DragItemsCount updates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
MartinZikmund and others added 6 commits November 2, 2026 10:14
Every element listening to Holding runs its own holding timer for the
press, and those timers can tick in any order. When an ancestor's timer
ticked first, it raised Holding from itself and the deepest listener
then raised it again, bubbling: a duplicate Started. Elapse the
descendants' holds of the same press first, deepest first, so the hold
is raised once and bubbles like on WinUI.

Exposed by ListViewBaseItem.OnHolding, which makes every ListView item
listen to Holding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
The one-drag-per-frame guard compared the FrameId with the last one,
which defaults to 0, so a drag on frame 0 never started. The first
injected touch sequence of a process has FrameId 0, which made the
first touch drag of a test run silently do nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
The implicit GridViewItem style is BasedOn DefaultGridViewItemStyle again,
as in WinUI, so default GridView items render through the ListViewItemPresenter
chrome and default to AllowDrop=True. The Fluent GridViewItemExpanded is removed.

Merge after #25403, #25404, #25406, #25409, #25411 and #25413.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu2NWgGKJFTAYtNHkvT
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/gridview-presenter-default branch from 1cc02e3 to aa6ac50 Compare November 2, 2026 09:17
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/listviewitempresenter branch 8 times, most recently from 9993875 to 5554bd3 Compare November 13, 2026 21:36
@MartinZikmund

Copy link
Copy Markdown
Member Author

Closing: this is now part of #25389, which carries this PR's feature and test commits, so default GridView items render through the presenter there. #25389 also moved from 7.0 to 7.1, so the 7.0 migration-guide changes in this PR no longer apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants