I'm working off of Microsoft's Shape Elements Sample. I'd like to modify it such that it draws into only a portion of the canvas. In the original XAML the blue grid spans the whole canvas. I would like to place that grid in the middle of a 3x3 super-grid. The blue grid (with math coordinates) should be positioned in the middle of the canvas.
Goal
What I have so far
<!-- This example shows how to draw Line elements. -->
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="Microsoft.Samples.Graphics.LineExample"
WindowTitle="Line Example" >
<StackPanel>
<Border>
<Border.Background>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#CCCCFF" Offset="0" />
<GradientStop Color="AliceBlue" Offset="0.25" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Border.Background>
<TextBlock Margin="10" HorizontalAlignment="Left">
Line Examples
</TextBlock>
</Border>
<StackPanel Margin="10">
<Border Style="{StaticResource MyGridBorderStyle}">
<Canvas Height="300" Width="300">
<!-- Draws a diagonal line from (10,10) to (50,50). -->
<Line
X1="10" Y1="10"
X2="50" Y2="50"
Stroke="Black"
StrokeThickness="4" />
<!-- Draws a diagonal line from (10,10) to (50,50)
and moves it 100 pixels to the right. -->
<Line
X1="10" Y1="10"
X2="50" Y2="50"
StrokeThickness="4"
Canvas.Left="100">
<Line.Stroke>
<RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">
<RadialGradientBrush.GradientStops>
<GradientStop Color="Red" Offset="0" />
<GradientStop Color="Blue" Offset="0.25" />
</RadialGradientBrush.GradientStops>
</RadialGradientBrush>
</Line.Stroke>
</Line>
<!-- Draws a horizontal line from (10,60) to (150,60). -->
<Line
X1="10" Y1="60"
X2="150" Y2="60"
Stroke="Black"
StrokeThickness="4"/>
</Canvas>
</Border>
</StackPanel>
</StackPanel>
</Page>
What modifications to this XAML are needed in order to accomplish my goal?