I've got a VisualBrush on which I've set the TileMode property to Tile.
However, it doesn't tile - it stretches. Can anyone assist please?
Thanks
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="test"
x:Name="UserControl"
d:DesignWidth="500" d:DesignHeight="500">
<UserControl.Resources>
<VisualBrush x:Key="MyBrush" TileMode="Tile">
<VisualBrush.Visual>
<Grid Width="20">
<Ellipse Fill="#FF00EBFF" Stroke="Black" StrokeThickness="2" Width="20" Height="20" RenderTransformOrigin="0.5,0.5" >
</Ellipse>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" >
<Grid Background="{StaticResource MyBrush}" />
</Grid>
</UserControl>
Try this:
You need to specify the ViewPort values when using TileMode.