You'll have make a render of UI controls.
Here is some sample code that creates a simple "Hello world" tile:
1. Instantiate the controls
var fontFamily = new FontFamily("Segoe WP SemiLight");
var fontColor = new SolidColorBrush(Colors.White);
var textTextBlock = new TextBlock()
{
Text = "Hello world!",
FontSize = 40,
Foreground = fontColor,
FontFamily = fontFamily
};
2. Render the controls as a WriteableBitmap
var bitmap = new WriteableBitmap(173, 173);
bitmap.Render(textTextBlock, new TranslateTransform()
{
X = 9,
Y = 9
});
bitmap.Invalidate();
If your layout is complex, my advice is to create the XAML first with a designer tool like Blend, and when it's done you do the same thing in C#.
EDIT: if you want to render a Grid
control, you need to add the Children elements to the grid:
grid.Children.Add(textTextBlock);
and call the following methods to ensure that the Controls are positionned correctly:
grid.UpdateLayout();
grid.Measure(new Size(tileWidth, tileHeight));
grid.Arrange(new Rect(0, 0, tileWidth, tileHeight));