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

MessageDialog is ignoring MaxHeight, but not MaxWidth #3967

Closed
CorsairRO opened this issue Nov 12, 2020 · 0 comments · Fixed by #3984
Closed

MessageDialog is ignoring MaxHeight, but not MaxWidth #3967

CorsairRO opened this issue Nov 12, 2020 · 0 comments · Fixed by #3984
Labels
Milestone

Comments

@CorsairRO
Copy link

Describe the bug

I am trying to limit my MessageDialogs to a maxwidth and maxheight Open from Mahapps.MetroWindow with SizeToContent = WidthAndHeight

I've tried to make a style for MessageDIalog and set the MaxWidth and MaxHeight

MaxWidth - works as it should
MaxHeight - is ignored.
The only way to make it work is to set the fixed Height. But this will look ugly for short messages like "Are you sure you want to do that?"

Steps to reproduce

Show a MahappsMetroWindow
Use ShowMessageAsync with a very long Message like : Lorem te ipsum.....

<Style TargetType="{x:Type mahDialogs:MessageDialog}" BasedOn="{StaticResource {x:Type mahDialogs:MessageDialog}}"> -> Works as expected -> Ignored -> Works, but not looking nice for shorter messages </Style>

Expected behavior

MaxHeight to work as MaxWidth.
Height works as it should, it adds scrollbars to text

Actual behavior

The Messagebox goes crazy long and tall that it doesnt fit to the screen and users dont see OK button, so that they have to kill the process from taskbar

Environment

MahApps.Metro version: v2.3.4
Windows build number: Win10 1909 [Version 10.0.18363.836]
Visual Studio: 2019 16.6.0
Target Framework: .Net v4.7.2

Screenshots

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

Successfully merging a pull request may close this issue.

2 participants