Try the following:
<UserControl x:Class="WpfApplication1.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <UserControl.Resources> <VisualBrush x:Key="MyBrush" TileMode="Tile" Viewport="20, 20, 20, 20" ViewportUnits="Absolute"> <VisualBrush.Visual> <Ellipse Fill="#FF00EBFF" Stroke="Black" StrokeThickness="2" Width="20" Height="20" RenderTransformOrigin="0.5,0.5" /> </VisualBrush.Visual> </VisualBrush> </UserControl.Resources> <Grid> <Grid x:Name="LayoutRoot" Background="{StaticResource MyBrush}"> </Grid> </Grid> </UserControl>
When using TileMode, you need to specify ViewPort values.
source share