Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions MahApps.Metro/Styles/Controls.DataGrid.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@

<Style x:Key="MetroDataGridRowHeader"
TargetType="{x:Type DataGridRowHeader}">
<Setter Property="HorizontalContentAlignment"
Value="Left" />
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

<Setter Property="VerticalContentAlignment"
Value="Center" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="BorderBrush"
Expand All @@ -268,10 +272,9 @@
Padding="{TemplateBinding Padding}"
Margin="{TemplateBinding Margin}"
SnapsToDevicePixels="True">
<StackPanel Orientation="Horizontal">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="Center" />
</StackPanel>
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Border>
<Thumb x:Name="PART_TopHeaderGripper"
VerticalAlignment="Top"
Expand Down