BaconographyW8.View.Markdown.MarkdownTable.MarkdownTable C# (CSharp) Метод

MarkdownTable() публичный Метод

public MarkdownTable ( IEnumerable headers, IEnumerable body ) : System
headers IEnumerable
body IEnumerable
Результат System
        public MarkdownTable(IEnumerable<UIElement> headers, IEnumerable<IEnumerable<UIElement>> body)
        {
            this.InitializeComponent();
            int x = 0, y = 0;
            theGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
            foreach (var header in headers)
            {
                theGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto });
                header.SetValue(Grid.ColumnProperty, x);
                header.SetValue(Grid.RowProperty, y);
                theGrid.Children.Add(header);
                x++;
            }

            foreach (var row in body)
            {
                theGrid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
                x = 0;
                y++;
                foreach (var column in row)
                {
                    column.SetValue(Grid.ColumnProperty, x);
                    column.SetValue(Grid.RowProperty, y);
                    theGrid.Children.Add(column);
                    x++;
                }

            }
        }
    }
MarkdownTable