Use VisualBrush to paint background : VisualBrush « Windows Presentation Foundation « C# / CSharp Tutorial






<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  x:Class="Microsoft.Samples.Graphics.UsingVisualBrush.PaintingWithVisuals">
    <StackPanel>
        <StackPanel.Background>
            <VisualBrush Opacity="0.1" Viewport="0,0,250,30" ViewportUnits="Absolute" TileMode="Tile" Stretch="None">
                <VisualBrush.Visual>
                    <Border Width="250" Background="Transparent">
                        <TextBlock Margin="5" FontSize="60px" >
              VisualBrush
              <TextBlock.Foreground>
                <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                  <LinearGradientBrush.GradientStops>
                    <GradientStop Offset="0.0" Color="Black" />
                    <GradientStop Offset="1.0" Color="Red" />
                  </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
              </TextBlock.Foreground>
                        </TextBlock>
                    </Border>
                </VisualBrush.Visual>
                <VisualBrush.RelativeTransform>
                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                </VisualBrush.RelativeTransform>
            </VisualBrush>
        </StackPanel.Background>
    </StackPanel>
</Page>
WPF Use Visual Brush To Paint Background








24.95.VisualBrush
24.95.1.Tiled VisualBrushTiled VisualBrush
24.95.2.VisualBrush and DrawingBrushVisualBrush and DrawingBrush
24.95.3.Simulating a reflection with VisualBrushSimulating a reflection with VisualBrush
24.95.4.Visual Brush For a RectangleVisual Brush For a Rectangle
24.95.5.Use VisualBrush to paint backgroundUse VisualBrush to paint background
24.95.6.Tile VisualBrushTile VisualBrush
24.95.7.VisualBrush Binding to a ButtonVisualBrush Binding to a Button
24.95.8.Gradient brushes within a DrawingBrushGradient brushes within a DrawingBrush