我想设置一个DrawingBrush
并DataGridCell
使用
<DrawingBrush TileMode="Tile" ViewportUnits="RelativeToBoundingBox" Viewport="0,0,0.05,1">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing>
<GeometryDrawing.Pen>
<Pen Brush="Gray" Thickness="0.05"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<LineGeometry StartPoint="0,1" EndPoint="1,0" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
DataGridCells
当宽度不相等时,我会得到不想要的结果,如下所示。
我应该如何更改画笔,以便无论单个单元格的宽度如何,结果都会像这样。