firstfloorsoftware / mui

Modern UI for WPF
Microsoft Public License
2.6k stars 754 forks source link

How do I control the width of a ModernUI dialog? #122

Open Rod-in-NM opened 8 years ago

Rod-in-NM commented 8 years ago

We've got a user control we're written that's meant to fit both in a window (works fine there) and now within a class I've defined from ModernDialog. The user control I'm trying to place on the ModernDialog derived class is wider than the ModernDialog allows for. When I run the app the ModernDialog cuts off both the left and right sides of the user control I've embedded on it. It looks awful. I've tried setting the Width property of the derived ModernDialog class both within the class itself and within the code that calls the class. The ModernDialog box consistently ignores all attempts I've made to control the ModernDialog's width. I've even tried creating the Loaded event for the ModernDialog and just flat out hard-coding some big enough value for Width just to see if I'd notice a difference. Forget it. The ModernDialog box just ignores anything and everything I've tried, to set the width of the window.

Why is it doing that?

Is it even possible to control with width of a ModernUI ModernDialog and if so how do I control the width of the ModernDialog?

bhutten14 commented 8 years ago

I have the same issue. Can't set the width of the dialog.

heraclesaraujo commented 8 years ago

Well... It happens because the Max/Min Width and Height are hard coded within the control template see here

So you've 2 options: 1 - Override the default template 2 - Change the template within the mui library

and you can send a PR so others can use these changes

bhutten14 commented 8 years ago

Ha, thanks! Its that easy. I think max width is good for text wrapping. So I would leave it as it is. I just did not think of the max width possibility.