OK I found by myself. Instead of declaring a
Path
object as a resource, I declared a
Style
for my paths. Then I created 2 paths and applied the style on them.
For those who might be interested, here is the code:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid Width="20" Height="20">
<Grid.Resources>
<Style x:Key="myPathStyle" TargetType="Path">
<Setter Property="Fill" Value="Blue" />
<Setter Property="Data">
<Setter.Value>
<GeometryGroup>
<RectangleGeometry Rect="0,0,10,10" />
<RectangleGeometry Rect="2,2,6,6" />
</GeometryGroup>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Path HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource myPathStyle}" />
<Path HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Style="{StaticResource myPathStyle}" />
</Grid>
</Page>