Mega Code Archive

 
Categories / C# / WPF
 

Two of the drawings rectangles are painted with an ImageBrush, creating a checkered pattern of images

<Window x:Class="Workspace.DockExample"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Workspace" Width="640" Height="480">       <Rectangle Width="50" Height="50" Grid.Row="0" Grid.Column="1">         <Rectangle.Fill>           <VisualBrush Viewport="0,0,1,0.25" TileMode="Tile" Stretch="Uniform">             <VisualBrush.Visual>               <StackPanel Background="White">                 <TextBlock FontSize="10pt" Margin="1">Hello, World!</TextBlock>               </StackPanel>             </VisualBrush.Visual>           </VisualBrush>         </Rectangle.Fill>       </Rectangle> </Window>