Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ArrangeWidgets(IEnumerable<UIElement> uiWidgets)
- {
- int curRow = -1;
- int curCol = 1;
- RowDefinitions.Clear();
- Children.Clear();
- if (uiWidgets != null)
- foreach (var curChild in uiWidgets)
- {
- Children.Add(curChild);
- if (curCol == 0)
- {
- curCol = 1;
- }
- else
- {
- curCol = 0;
- curRow++;
- RowDefinitions.Add(new RowDefinition()
- {
- Height = new GridLength(1, GridUnitType.Auto)
- });
- }
- Grid.SetRow((FrameworkElement)curChild, curRow);
- Grid.SetColumn((FrameworkElement)curChild, curCol);
- }
- RowDefinitions.Add(new RowDefinition()
- {
- Height = new GridLength(1, GridUnitType.Star)
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement