You can also copy the Path according to your geometry, but use CombinedGeometrywith a sufficiently large external RectangleGeometry and excluded internal geometry provided by Path Data:
<Path ...>
<Path.Clip>
<CombinedGeometry
GeometryCombineMode="Exclude"
Geometry2="{Binding Data, RelativeSource={RelativeSource AncestorType=Path}}">
<CombinedGeometry.Geometry1>
<RectangleGeometry Rect="-1000,-1000,2000,2000"/>
</CombinedGeometry.Geometry1>
</CombinedGeometry>
</Path.Clip>
</Path>
Alternatively, you can draw a second filled Path with the same geometry on top of the first. You must make sure that they are both the same.
<Path x:Name="path" ...>
<Path Fill="White" Data="{Binding Data, ElementName=path}"/>
source
share