I am trying to make some Graph Paper using WPF using the DrawingBrush.
I found the following example on MSDN which is pretty close to what I want but not exactly. I want to do this is pure XAML. I am fairly new to WPF.
<DrawingBrush x:Key="GridTile"
Viewport="0,0,10,10"
ViewportUnits="Absolute"
TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Geometry="M0,0 L1,0 1,0.1, 0,0.1Z" Brush="Blue" />
<GeometryDrawing Geometry="M0,0 L0,1 0.1,1, 0.1,0Z" Brush="Red" />
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
Currently this generates

I want to generate
with a width of 3cm and each row being 4mm

I will use this tile my background or rather the DrawingBrush TileMode takes care of that for me.
Change the size of the
Brushso theViewporthas more height than width, and change theGeometryaccordingly so the lines still appear1pxthick.