Skip to content

Instantly share code, notes, and snippets.

@atzimler
Created May 24, 2017 12:00
Show Gist options
  • Select an option

  • Save atzimler/94c7c1c39f7c03383a9453b3a4ba9516 to your computer and use it in GitHub Desktop.

Select an option

Save atzimler/94c7c1c39f7c03383a9453b3a4ba9516 to your computer and use it in GitHub Desktop.
public class LeftRightLayoutControl : StackPanel
{
private Grid _grid;
private StackPanel _left;
private StackPanel _right;
public LeftRightLayoutControl()
{
_grid = new Grid();
_grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
_grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
_grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
_left = new StackPanel();
Grid.SetRow(_left, 0);
Grid.SetColumn(_left, 0);
_grid.Children.Add(_left);
_right = new StackPanel();
Grid.SetRow(_right, 0);
Grid.SetColumn(_right, 1);
_grid.Children.Add(_right);
Children.Add(_grid);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment