Q:

Rectangle doesn't show up in programmatically coded interface

I'm building an interface via code and I need to add two TextBlocks and one Rectangle under the TextBlocks as a background. With my code the TextBlocks show up but the Rectangle doesn't. I don't know what the problem is. Could you help?
TextBlock question_textblock = new TextBlock();
question_textblock.Text = question;
question_textblock.Margin = new Thickness(10, 103, 10, 0);
question_textblock.FontWeight = FontWeights.Bold;
list_grid.Children.Add(question_textblock);

TextBlock answer_textblock = new TextBlock();
answer_textblock.Text = question;
answer_textblock.Margin = new Thickness(10, 124, 10, 0);
list_grid.Children.Add(answer_textblock);

Rectangle rect = new Rectangle();
rect.Height = 69;
rect.Fill = new SolidColorBrush(Color.FromArgb(0, 0, 0, 1));
rect.Margin = new Thickness(0, 95, 0, 0);
rect.VerticalAlignment = VerticalAlignment.Top;
list_grid.Children.Add(rect);

list_grid.UpdateLayout();

A:

To solve: Add the Rectangle as a first child to your list_grid like below and if it still doesn't show up choose a different color to fill Rectangle. This should be what you want:
Rectangle rect = new Rectangle();
rect.Height = 69;
rect.Fill = new SolidColorBrush(Colors.Gray);
rect.Margin = new Thickness(0, 95, 0, 0);
rect.VerticalAlignment = VerticalAlignment.Top;
list_grid.Children.Add(rect);

TextBlock question_textblock = new TextBlock();
question_textblock.Text = question;
question_textblock.Margin = new Thickness(10, 103, 10, 0);
question_textblock.FontWeight = FontWeights.Bold;
list_grid.Children.Add(question_textblock);

TextBlock answer_textblock = new TextBlock();
answer_textblock.Text = question;
answer_textblock.Margin = new Thickness(10, 124, 10, 0);
list_grid.Children.Add(answer_textblock);

list_grid.UpdateLayout();

