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

ShowDialog() ignores WindowStartupLocation #2207

Closed
braca opened this issue Dec 31, 2018 · 3 comments · Fixed by #2250
Closed

ShowDialog() ignores WindowStartupLocation #2207

braca opened this issue Dec 31, 2018 · 3 comments · Fixed by #2250
Assignees
Labels

Comments

@braca
Copy link

braca commented Dec 31, 2018

Using the latest code from master, setting a window WindowStartupLocation property has no effect when using ShowDialog(..). If I use Show() it works properly

I've tried both WindowStartupLocation.CenterScreen and WindowStartupLocation.CenterOwner

Example

var window = new Window();
window.Height = 100;
window.Width = 100;
window.Content = new TextBlock { Foreground = Brushes.White, Text = "Test" };
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
window.ShowDialog(Application.Current.MainWindow);

Expected behaviour
Window should be displayed in the desired location

@Gillibald
Copy link
Contributor

It seems the call to https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/Window.cs#L463 is missing in the ShowDialog implementation.

@x2bool
Copy link

x2bool commented May 21, 2019

WindowStartupLocation.CenterOwner is probably still broken on MacOS, but works as it should on Windows.

Right now showing a dialog on Mac centers dialog to the right of the parent window.

@mat1jaczyyy
Copy link
Contributor

mat1jaczyyy commented May 28, 2019

CenterOwner works fine on macOS in my app, although I'm using Show().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants