lepoco / lepoco/wpfui

MessageBox WindowStartupLocation does not work

Open
#1,045 14 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.