I can\'t understand why this doesn\'t work, or what I need to get it to work.
To repro, create a simple WPF application and replace the main window\'s constructor th
Because elements don't have a desired size until you measure them. You were telling the Grid to size itself with an available space of 0x0. Change your code to:
grid.Measure(new Size(grid.Width, grid.Height));
grid.Arrange(new Rect(new Size(grid.Width, grid.Height)));
(The call to UpdateLayout is unneeded.)