Skip to content

Conversation

chuuddo
Copy link
Contributor

@chuuddo chuuddo commented Feb 26, 2015

Now we can use style like this

<Style x:Key="RowHeaderStyle" TargetType="DataGridRowHeader"
       BasedOn="{StaticResource MetroDataGridRowHeader}">
    <Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
<DataGrid RowHeaderStyle="{StaticResource RowHeaderStyle}" />

screenshot_1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default should be Stretch, or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@punker76 dont know, but in MetroDataGridColumnHeader default is Left.

<Style x:Key="MetroDataGridColumnHeader"
           TargetType="{x:Type DataGridColumnHeader}">
       ...
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />

https://msdn.microsoft.com/en-us/library/system.windows.controls.control.horizontalcontentalignment(v=vs.110).aspx

One of the HorizontalAlignment values. The default is HorizontalAlignment.Left.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i know, but the default before your changes is Stretch (it's the default if you doesn't say HorizontalAlignement="xyz")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right

@punker76 punker76 added this to the 1.1.2 milestone Feb 26, 2015
punker76 added a commit that referenced this pull request Feb 26, 2015
Added alignment properties for MetroDataGridRowHeader
@punker76 punker76 merged commit f1715e5 into MahApps:master Feb 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants