Exeption thrown when ExtendsContentIntoTitleBar="True" WindowBackdropType="Mica" is added to UI:Window
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Wpf.Ui!Wpf.Ui.Interop.User32::SetWindowLong' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature
To Reproduce
- Create a Wpf project in .net 4.8
- add WPFUI nuget package
- Change mainWindow to ui:UIwindow
- Change mainwindow code behind to inherit from INaviagtionWindow
- add ThemesDictionary and Controls Dictionary to Resource dictionary
- add ExtendsContentIntoTitleBar="True" to Mainwindow
- WindowBackdropType="Mica" to Mainwindow
- Dubug the application
Expected behavior
Unbalanced stack exception shouldn't be thrown
Screenshots
No response
OS version
Windows 11 and Windows 10
.NET version
4.8
WPF-UI NuGet version
2.0.3
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Wpf.Ui.Interop.User32::SetWindowLong P/Invoke call implicated by the Managed Debugging Assistant, then reproduce the issue using the listed .NET Framework 4.8, UI:Window, title-bar, and Mica settings. Done means the provided WPF project no longer reports a PInvokeStackImbalance exception while debugging on Windows 10 or 11.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100