I'm searching for the best method to make pattern for background of canvas. I want to show user canvas with drawed lines, which will show borders for different size of document, e.g. Paper A4.
I'v made it by using DrawingBrush in XAML. Here is my code:
<DrawingBrush x:Key="BackgroundPattern" ViewportUnits="Absolute" Stretch="None" TileMode="Tile">
<DrawingBrush.Viewport>
<Rect X="0" Y="0" Width="1089" Height="1842"/>
</DrawingBrush.Viewport>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Blue">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry>
<RectangleGeometry.Rect>
<Rect X="0" Y="0" Width="1089" Height="1842"/>
</RectangleGeometry.Rect>
</RectangleGeometry>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#FFB9B9B9">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry>
<RectangleGeometry.Rect>
<Rect X="1" Y="1" Width="1088" Height="1841"/>
</RectangleGeometry.Rect>
</RectangleGeometry>
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
I'm using this brush in tile mode, there is effect:

I'm afraid of the size of my elements - Viewport size is 1089x1842. Is there any other way to make these?