Skip to content

Instantly share code, notes, and snippets.

@kbaesler
Created September 25, 2018 14:17
Show Gist options
  • Save kbaesler/a00121863ce7614ae778695df57705d7 to your computer and use it in GitHub Desktop.
Save kbaesler/a00121863ce7614ae778695df57705d7 to your computer and use it in GitHub Desktop.
Properties to Set When Using a Horizontal or Vertical GridSplitter

To get the desired behavior when using a GridSplitter element, you need to set HorizontalAlignment and VerticalAlignment properties as shown below.

For a vertical splitter:

  • Put GridSplitter in its own column, setting column’s width to Auto
  • Set Grid.RowSpan to span all rows of the Grid
  • No need to set Grid.Row property (defaults to 0)
  • Set Width of GridSplitter to be desired thickness
  • Set HorizontalAlignment to Center
  • Set VerticalAlignment to Stretch

For a horizontal splitter:

  • Put GridSplitter in its own row, setting row’s height to Auto
  • Set Grid.ColumnSpan to span all columns of the Grid
  • No need to set Grid.Column property (defaults to 0)
  • Set Height of GridSplitter to be desired thickness
  • Set HorizontalAlignment to Stretch
  • Set VerticalAlignment to Center
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment