Skip to content

Drag Preview Content and Opacity#1001

Merged
wieslawsoltes merged 2 commits intomasterfrom
feature/drag-preview-content-opacity
Jan 22, 2026
Merged

Drag Preview Content and Opacity#1001
wieslawsoltes merged 2 commits intomasterfrom
feature/drag-preview-content-opacity

Conversation

@wieslawsoltes
Copy link
Owner

Drag Preview Content and Opacity

Summary

This change adds full drag preview support for IDock layouts, including the ability to render dockable content during drag and to control preview opacity via DockSettings. The preview window now renders dock containers using the same default data templates that DockControl injects, preventing view locator failures and enabling nested layouts to display correctly while dragging.

Implementation details

  • Added new settings:
    • DockSettings.ShowDockablePreviewOnDrag to toggle rendering dockable content inside the preview window.
    • DockSettings.DragPreviewOpacity to control preview window opacity.
  • Extended DragPreviewControl with:
    • ShowContent, PreviewContentWidth, and PreviewContentHeight properties for sizing and toggling the content preview.
  • Updated DragPreviewHelper to:
    • Initialize default dock DataTemplates for DragPreviewControl using DockDataTemplateHelper.
    • Compute preview sizing from tracked dockable bounds with fallback defaults.
    • Apply clamped opacity (0.0 to 1.0) to the preview window.
  • Updated the Fluent theme preview template to display both status and optional dockable content.
  • Wired the ReactiveUI sample to enable dockable previews and set preview opacity.

Usage

Enable dockable preview content:

DockSettings.ShowDockablePreviewOnDrag = true;

Set preview opacity (0.0 to 1.0):

DockSettings.DragPreviewOpacity = 0.6;

AppBuilder shortcuts:

AppBuilder.Configure<App>()
    .UsePlatformDetect()
    .ShowDockablePreviewOnDrag()
    .SetDragPreviewOpacity(0.6);

Tests

  • dotnet test

Fixes #339

Expose preview options through DockSettings and app builder helpers.
Describe preview content and opacity options in docs.
@wieslawsoltes wieslawsoltes merged commit 42834d7 into master Jan 22, 2026
8 checks passed
@wieslawsoltes wieslawsoltes deleted the feature/drag-preview-content-opacity branch January 22, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visible Panel while dragging

1 participant