Skip to content

Instantly share code, notes, and snippets.

@odugen
Created June 11, 2014 07:26
Show Gist options
  • Select an option

  • Save odugen/7e9cef872a853d48b03f to your computer and use it in GitHub Desktop.

Select an option

Save odugen/7e9cef872a853d48b03f to your computer and use it in GitHub Desktop.
WPF HorizontalHeaderedContentControl style
<Window.Resources>
<Style TargetType="{x:Type HeaderedContentControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type HeaderedContentControl}">
<Grid Margin="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="172"/>
<ColumnDefinition Width="8" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentPresenter ContentSource="Header" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="0"/>
<ContentPresenter Grid.Column="2"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment