C# WPFで グリッドマーク上にTextBlockやRectangleを配置する

供養

var textBlock = new TextBlock
{
    HorizontalAlignment = HorizontalAlignment.Center,
    VerticalAlignment = VerticalAlignment.Center,
    Text = text,
    FontSize = 0.1
};
var rectangle = new Rectangle
{
    Stroke = Brushes.Black,
    StrokeThickness = 0.3
};
Grid.SetColumn(textBlock, x);
Grid.SetRow(textBlock, y);
Grid2.Children.Insert(0, textBlock);

Grid.SetColumn(rectangle, x - 1);
Grid.SetColumnSpan(rectangle, 3);
Grid.SetRow(rectangle, y - 1);
Grid.SetRowSpan(rectangle, 3);
Grid2.Children.Insert(0, rectangle);