Skip to content

HorizontalAlignment of BaseMetroDialog content #3100

@pfattisc

Description

@pfattisc

What steps will reproduce this issue?

The original dialog (note: the content is 'spread', i.e. the space between the left corner of the dialog's title and the buttons in the right bottom corner):
spreadcontent

The problem is that the "stripe", where dialogs are presented in, is separated into three columns (width: 25*, 50*, 25*) and the dialog's contentpresenter resides in the middle column.
So if the custom content isn't spread all over the content area, the alignment of the content seems left orientated (since the first column width of 25* is relative and won't grow)

Content seems 'left orientated' (Note: Space on the left side of the content is less than the space on the right side of the content)
leftalignedcontent

To fix this the HorizontalAlignment of the 'core" grid (the one that hosts contentpresenter and PART_Title) should be HorizontalAlignment="Center".
So can you (=> bind to parent HorizontalContentAlignment).

Expected outcome

It should be possible to set alignment of a BaseMetroDialog's content.
Frankly, just bind the HorizontalAlignment of the 'core grid' to the BaseMetroDialog's HorizontalContentAlignment in the controltemplate.

Expected Dialog (note: the whole content is center aligned):
expectedcenteredalignment

Repo

None :-(

Environment

  • MahApps.Metro v1.5.23

  • Windows OS 10.0.14393 (x64)

  • Visual Studio 2015

  • .NET Framework 4.7.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions