Skip to content

Port the ListViewItemPresenter/GridViewItemPresenter drag visual (DragBackground, DragForeground, DragOpacity) #25922

Open

Description

@MartinZikmund

What would you like to be added? 💡

The drag visual part of the ListViewItemPresenter / GridViewItemPresenter chrome, ported from WinUI. PR #25389 ports the chrome, but these properties are still marked [Uno.NotImplemented] because nothing reads them yet:

  • ListViewItemPresenter.DragBackground, DragForeground, DragOpacity
  • GridViewItemPresenter.DragBackground, DragForeground, DragOpacity

That needs:

  • ListViewBaseItem.SetDragVisualCaptured wired to the drag start (ListViewBaseItem_Partial.cpp:2498). Uno has it ported (ListViewBaseItem.mux.cs), but nothing calls it, so the Dragging/DraggedPlaceholder/Reordering visual states can never be reached.
  • The chrome's drag layers, which paint with m_pDragBackground / m_pDragForeground (ListViewBaseItemChrome.cpp around lines 1319-1335).
  • The drag visual's opacity set from CListViewBaseItemChrome::GetDragOpacity() (ListViewBaseItemChrome.cpp:1882), the way ListViewBaseItem::StartDrag does (ListViewBaseItem_Partial.cpp:1776-1781).
  • Removing [Uno.NotImplemented] from the six properties, with runtime tests covering the dragged and placeholder states.

Why is this needed? 🤔

Apps that restyle drag feedback through these properties (ListViewItemDragBackground, ListViewItemDragThemeOpacity, etc.) see no effect today. Dragged items in a reorderable ListView/GridView also don't get WinUI's dragged/placeholder look.

For which platforms 📱💻🖥️

All (Skia)

Anything else we need to know? 💬

Follow-up to #25389 (ListViewItemPresenter/GridViewItemPresenter chrome port), raised in review. The surrounding code carries the matching TODO Uno markers in ListViewBaseItemChrome.h.mux.cs (the property readers are in #if false).

Activity

  1. added
    kind/enhancement
    area/listview 📃
    project/items 🧾
    area/porting 🖨️
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/listview 📃area/porting 🖨️kind/enhancementproject/items 🧾

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions