Skip to content

Update MahApps to restore .NET 10 window dragging - #365

Merged
tgjones merged 1 commit into
tgjones:masterfrom
kornman00:kornman00-caliburn5-upgrade-mahapps
Sep 25, 2026
Merged

tgjones merged 1 commit into
tgjones:masterfrom
kornman00:kornman00-caliburn5-upgrade-mahapps

Conversation

@kornman00

@kornman00 kornman00 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Update MahApps.Metro from 2.4.9 to 2.4.11 to address title-bar dragging under .NET 10.

Gemini's main window derives from MetroWindow. MahApps 2.4.9 obtains the native window handle by reflecting WPF's private Window.CriticalHandle property. That path returns no usable handle under .NET 10, so the window starts normally but title dragging does nothing. MahApps 2.4.11 fixes MahApps.Metro#4554 by using WindowInteropHelper.EnsureHandle().

This PR also adds a small non-packable .NET 10 WPF compatibility host. The same host source can run against either package version, making the before/after behavior reproducible without adding a general test framework. Its README records the fixture's provenance and objective removal criteria.

Scope

  • update MahApps.Metro from 2.4.9 to 2.4.11;
  • update the declarative package contract accordingly;
  • add the focused MahApps.Net10DragHost compatibility executable;
  • build the host through the existing solution/CI path.

Intentionally unchanged:

  • Gemini library targets remain net462, net6.0-windows, and net7.0-windows;
  • Caliburn.Micro remains 4.0.210;
  • AvalonDock, ControlzEx, the WPF toolkit, Composition, and other application dependencies are unchanged;
  • publication guards and release credentials are unchanged;
  • this does not adopt MahApps 3 or add .NET 10 as a Gemini library target.

Evidence

  • On .NET 10.0.11, the 2.4.9 host opens but does not move when dragging the title bar in either normal or maximized state.
  • Both the 2.4.9 and 2.4.11 host variants restore, build, start, and obtain a native window handle successfully.
  • The 2.4.11 source uses the released WindowInteropHelper.EnsureHandle() fix in the affected drag path.
  • Before marking ready: manually confirm normal title drag and maximized drag-to-restore with the 2.4.11 host.

Validation

  • dotnet restore src\Gemini.sln --configfile src\NuGet.config
  • dotnet build src\Gemini.sln --configuration Release --no-restore
  • compatibility-host smoke runs with MahApps 2.4.9 and 2.4.11
  • dotnet pack src\Gemini.sln --configuration Release --no-build --no-restore --output build\packages
  • eng\validate-artifacts.ps1

The package validator produced and verified all eight primary packages and eight symbol packages across the existing three framework groups. The resolved Gemini graph retains ControlzEx 4.4.0 and all unrelated direct dependency versions.

Base and rollback

Based on tgjones/gemini:master at f8116862639b7d0e1c32a115b938bf5ac1ce47d9.

The change is isolated to one dependency version, its package-contract entry, and the compatibility host. Reverting this PR restores MahApps 2.4.9 and removes the host; it does not require a state/data migration or package publication change.

Add a focused net10 WPF compatibility host that reproduces the MahApps 2.4.9 title-drag failure and documents when the host can be retired.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kornman00
kornman00 marked this pull request as ready for review September 20, 2026 10:36
@kornman00

Copy link
Copy Markdown
Contributor Author

@tgjones when you have time, it would be good to refresh your nuget token and then thumbs up/down this PR (or re-run the failed job on the last run).

No real rush. I have a second PR locally that will follow this one that adds dotnet 10 while still retaining 6/7. It is mostly straight forward, besides some ps1 updating for per-nuspec-TFM external dependency overrides.

I wanted to split up the PRs to keep things simple and straight forward to review, rather than monolithic reviews that update/change a bunch of code. However, if you prefer more monolithic reviews with backing incremental commits, I can switch to that style as well.

Cheers!

@tgjones

tgjones commented Sep 25, 2026

Copy link
Copy Markdown
Owner

@kornman00 I've just fixed it now. It seems NuGet API keys are going away, and the new thing is "trusted publishing". Looks like the publishing workflow works again now.

@tgjones
tgjones merged commit 0d77579 into tgjones:master Sep 25, 2026
2 checks passed
@tgjones

tgjones commented Sep 25, 2026

Copy link
Copy Markdown
Owner

I wanted to split up the PRs to keep things simple and straight forward to review, rather than monolithic reviews that update/change a bunch of code. However, if you prefer more monolithic reviews with backing incremental commits, I can switch to that style as well.

Thanks for asking. I prefer smaller PRs to review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows not movable with .NET 10

2 participants