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

Ability to set the gutter on CustomDialog #3484

Closed
gnewtzie opened this issue Apr 16, 2019 · 2 comments · Fixed by #3518
Closed

Ability to set the gutter on CustomDialog #3484

gnewtzie opened this issue Apr 16, 2019 · 2 comments · Fixed by #3518
Milestone

Comments

@gnewtzie
Copy link

gnewtzie commented Apr 16, 2019

Is your feature request related to a problem? Please describe.
When showing a CustomDialog, I would like the ability to change the default gutter on the left and right of the content, so that i can show more content.
The existing implementation uses a fixed 25* grid column definition, hard coded in the CustomDialog template.

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="25*" />
                    <ColumnDefinition Width="50*" />
                    <ColumnDefinition Width="25*" />
                </Grid.ColumnDefinitions>

Describe the solution you'd like
I'd like to be able to set the width weighting for the gutter from the MetroDialogSettings when passing in to the .ShowMetroDialogAsync() method. Something more like:

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="{Binding GutterPercent}" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="{Binding GutterPercent}" />
                </Grid.ColumnDefinitions>

Additional context

Closed Issues

@Evangelink
Copy link
Contributor

FYI I have deleted my previous post

We can actually handle this in quite a lot of ways:

  • Bind each margin to a double property which represents a percentage (ratio) and use a converter to transform this value into a GridLength and fix the middle column to *. The drawback of the double property is that the user can't define a fix margin (e.g. 300).

  • Bind each margin directly to a GridLength property and fix the middle column to *.

  • Fix the left and right columns to * and allow to bind the middle column width (again there is the question of using double or GridLength)

  • Use some kind of enumeration for the left/right margin space like NoMargin, SmallMargin, LargeMargin, honestly I don't think that's a really good idea because we are putting a useless limit to the customization.

cc @punker76

When the choice is made, I will happily create a PR for this.

punker76 added a commit that referenced this issue Jun 4, 2019
Add properties to allow set the inner content GridLength.

- DialogContentMargin: Gets or sets the left and right margin for the dialog content. (default 25*)
- DialogContentWidth: Gets or sets the width for the dialog content. (default 50*)
@punker76
Copy link
Member

punker76 commented Jun 4, 2019

@Evangelink #3518

@punker76 punker76 added this to the 2.0.0 milestone Jun 4, 2019
punker76 added a commit that referenced this issue Jun 4, 2019
…r_Column_GridLength

(GH-3484) Allow set Dialogs inner content Column GridLength
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants