<Window x:Class="CheckerBackground.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Checker Background"
Width="525"
Height="350">
<Window.Resources>
<SolidColorBrush x:Key="DarkSquareColor" Color="#18FFFFFF" />
<SolidColorBrush x:Key="LightSquareColor" Color="#34FFFFFF" />
<DrawingBrush x:Key="CheckerBackground"
Stretch="None"
TileMode="Tile"
Viewport="0,0,20,20"
ViewportUnits="Absolute">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="{StaticResource DarkSquareColor}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0,10,10" />
<RectangleGeometry Rect="10,10,10,10" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="{StaticResource LightSquareColor}">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="10,0,10,10" />
<RectangleGeometry Rect="0,10,10,10" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Window.Resources>
<Grid>
<Rectangle Fill="#FF000000" />
<Rectangle Fill="{DynamicResource CheckerBackground}" />
</Grid>
</Window>
Friday, 6 April 2012
Checker brush
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment