Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageBox WindowStartupLocation does not work #1045

Open
maslewandowski opened this issue Apr 10, 2024 · 3 comments
Open

MessageBox WindowStartupLocation does not work #1045

maslewandowski opened this issue Apr 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@maslewandowski
Copy link

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

@maslewandowski maslewandowski added the bug Something isn't working label Apr 10, 2024
@SlimeNull
Copy link

You need to set the owner of the window first

@SlimeNull
Copy link

Like this:

var uiMessageBox = new Wpf.Ui.Controls.MessageBox
{
    Title = "test",
    Content = "test",
    WindowStartupLocation = WindowStartupLocation.CenterOwner
};
uiMessageBox.Owner = Application.Current.MainWindow;
await uiMessageBox.ShowDialogAsync();

@m0lDaViA
Copy link
Contributor

m0lDaViA commented May 8, 2024

@maslewandowski Does that fix your issue? If yeas, please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants