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

WindowManager MessageBox UI issue #138

Open
zsonglorman opened this issue Jul 4, 2020 · 9 comments
Open

WindowManager MessageBox UI issue #138

zsonglorman opened this issue Jul 4, 2020 · 9 comments

Comments

@zsonglorman
Copy link

Dear,

First of all, thank you for all your work, I find this project truly useful for my developments.

I'm using the WindowManager to show Stylet's own MessageBox as discussed in the docs:

this.windowManager.ShowMessageBox($"Error message here.", "Warning", MessageBoxButton.YesNoCancel, MessageBoxImage.Warning);

It works, however, the buttons on the MessageBox are strange-looking:

messagebox

Do you have any idea what could cause this issue?
Thanks a lot in advance!

@canton7
Copy link
Owner

canton7 commented Jul 4, 2020

That's very weird, I haven't seen that before. If you create a <Button> yourself, does it look the same?

@zsonglorman
Copy link
Author

Yes, it's very strange, and all other controls including buttons work just fine in windows, usercontrols etc.

@kaisame
Copy link

kaisame commented Jul 17, 2020

try change the font size

@Coke21
Copy link

Coke21 commented Feb 12, 2021

Hi, sorry for the thread bumping but I'm also having the same problem:
_windowManager.ShowMessageBox("test", "Test", MessageBoxButton.OK, MessageBoxImage.Hand);
Shows:

I'm not sure if it helps but I'm using ModernWpf as UI framework -> https://github.com/Kinnara/ModernWpf
I executed the aforementioned code in my ViewModel:

        private readonly IWindowManager _windowManager;
        public RootViewModel(IWindowManager windowManager)
        {
             _windowManager = windowManager;
             _windowManager.ShowMessageBox("test", "Test", MessageBoxButton.OK, MessageBoxImage.Hand);
        }

Does anyone know how to fix the button? Other "normal" buttons work normally, thanks

@Nikey646
Copy link

Would the fix to this issue be simply changing the Height property to MinHeight, then allowing the button to presumably automatically increase in height when the font size?

@mortan
Copy link

mortan commented Jun 9, 2021

Hi there, I got the same problem as @Coke21. My messagebox button is a) not centered and b) clipping.

grafik

I would imagine that the "not centered" part is coming from this code (unfortunately I can't test it):

grafik
https://github.com/canton7/Stylet/blob/master/Stylet/MessageBoxView.xaml

Would be awesome if this gets fixed, if you need anything let me know.

@TheVeryStarlk
Copy link

TheVeryStarlk commented Oct 20, 2021

Have you tried this:

<Style TargetType="TextBlock">
     <Setter Property="VerticalAlignment" Value="Center" />
</Style>

@steveyan00
Copy link

I'm using HandyControl as UI framework and I'm having the same problem. Also, MessageBox cannot adapt to dark mode.
Is it possible to allow customizing the style of MessageBox in future versions?

@TheVeryStarlk
Copy link

I'm using HandyControl as UI framework and I'm having the same problem. Also, MessageBox cannot adapt to dark mode. Is it possible to allow customizing the style of MessageBox in future versions?

I believe this is related to HandyControl more than Stylet.

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

No branches or pull requests

8 participants