Skip to content

Instantly share code, notes, and snippets.

@cabrel
Created February 24, 2013 21:49
Show Gist options
  • Save cabrel/5025830 to your computer and use it in GitHub Desktop.
Save cabrel/5025830 to your computer and use it in GitHub Desktop.
WPF ToolBar Content Alignment
<ToolBar>
<ToolBar.Resources>
<Style TargetType="{x:Type ToolBarPanel}">
<Setter Property="Orientation" Value="Vertical"/>
</Style>
</ToolBar.Resources>
<!-- This is the downside of this solution:
You have to set the height at some level (once)
or you will end up with controls forcing
the toolbar to auto-size until it fills up it's parent -->
<DockPanel Height="48">
<Button Name="ButtonOne" Click=ButtonOne_Click" />
<Button Name="ButtonTwo" Click=ButtonTwo_Click" />
<Button Name="ButtonThree" Click="ButtonThree_Click" HorizontalAlignment="Right" />
</DockPanel>
</ToolBar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment