MessageBox WindowStartupLocation does not work
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
When showing the custom Messagebox in namespace Wpf.Ui.Controls.MessageBox it is not possible to set the messagebox start up location to center owner.
therefore the messagebox is always shown at the center location where the app did start.
To Reproduce
var uiMessageBox = new Wpf.Ui.Controls.MessageBox
{
Title = "test",
Content = "test",
WindowStartupLocation = WindowStartupLocation.CenterOwner
};
await uiMessageBox.ShowDialogAsync();
Expected behavior
It should be shown in the center of the owner window
Screenshots
No response
OS version
windows 11 pro 23H2 22631.3374
.NET version
Target: net8.0-windows7.0
WPF-UI NuGet version
3.0.0-preview.13
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 at Wpf.Ui.Controls.MessageBox and trace ShowDialogAsync using the reproduction with WindowStartupLocation.CenterOwner. Verify how the owner window is established; done means the custom message box opens centered on its owner rather than the application's startup center.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100