각은 자신의 배경 펜, 루트 캔버스에 여러 개의 캔버스를 추가 할 수 있습니다
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<Canvas Width="10000" Height="10000">
<Canvas Width="10000" Height="10000">
<Canvas.Background>
<DrawingBrush Stretch="None" TileMode="Tile"
Viewport="0,0 10,10" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="0,10"/>
<LineGeometry StartPoint="0,0" EndPoint="10,0"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="1" Brush="DarkGray"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Canvas.Background>
</Canvas>
<Canvas Width="10000" Height="10000">
<Canvas.Background>
<DrawingBrush Stretch="None" TileMode="Tile"
Viewport="0,0 50,50" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="0,50"/>
<LineGeometry StartPoint="0,0" EndPoint="50,0"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="1" Brush="Blue"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Canvas.Background>
</Canvas>
<Canvas Width="10000" Height="10000">
<Canvas.Background>
<DrawingBrush Stretch="None" TileMode="Tile"
Viewport="0,0 100,100" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="0,100"/>
<LineGeometry StartPoint="0,0" EndPoint="100,0"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="1" Brush="Red"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Canvas.Background>
</Canvas>
</Canvas>
</ScrollViewer>
또는 어떤 UIElement
에서 브러시를 구성 VisualBrush
을 사용할 수 있습니다. 그래서 당신은 내부 Rectangles
와 Grid
에서 캔버스 배경을 만들거나 유사한 접근 할 수 :
<Canvas>
<Canvas.Background>
<VisualBrush>
<VisualBrush.Visual>
<Grid>
<Rectangle Width="10000" Height="10000">
<Rectangle.Fill>
<DrawingBrush Stretch="None" TileMode="Tile"
Viewport="0,0 10,10" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="0,10"/>
<LineGeometry StartPoint="0,0" EndPoint="10,0"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="1" Brush="DarkGray"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle Width="10000" Height="10000">
<Rectangle.Fill>
<DrawingBrush Stretch="None" TileMode="Tile"
Viewport="0,0 50,50" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="0,50"/>
<LineGeometry StartPoint="0,0" EndPoint="50,0"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="1" Brush="Blue"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle Width="10000" Height="10000">
<Rectangle.Fill>
<DrawingBrush Stretch="None" TileMode="Tile"
Viewport="0,0 100,100" ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<GeometryGroup>
<LineGeometry StartPoint="0,0" EndPoint="0,100"/>
<LineGeometry StartPoint="0,0" EndPoint="100,0"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="1" Brush="Red"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Canvas.Background>
</Canvas>
감사 McGarnagle !!!!! – user3130331
다시 한번 감사드립니다 ... 나는 첫 번째 옵션을 테스트했으며 챔피언처럼 작동합니다. 제 첫 번째 옵션은 제가 갈 것입니다. – user3130331