Func<Article, object> orderByFunc = (a) =>
typeof(Article).GetProperty(OrderBy).GetValue(a);
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
RowDefinitionCollection rd = MainGrid.RowDefinitions;
ColumnDefinitionCollection cd = MainGrid.ColumnDefinitions;
for (int i = 0; i < 3; i++)
{
rd.Add(new RowDefinition());
for (int j = 0; j < 12; j++)
{
cd.Add(new ColumnDefinition());
Button b = new Button();
b.Name = "Button"+i;
MainGrid.Children.Add(b);
Grid.SetColumn(b, j);
Grid.SetRow(b, i);
}
}